Investigating possibly redundant network traffic between mongoose and mongodb when connection is made with useUnifiedTopology option
Without the useUnifiedTopology connection parameter set to true, mongoose opens one connection to mongodb to save a record. However, with the useUnifiedTopology connection parameter set to true, mongoose opens two connections to mongodb to save a record. The first connection sends system settings and receives configuration parameters from mongodb. The second connection repeats this process before sending the record to be inserted. The network traffic associated with this process appears to be redundant.
default.jsthis file makes a connection to mongodb using default configuration and saves one recordunified.jsthis file makes a connection to mongodb using useUnifiedTopology and saves one recorddefault.pcapcaptured network traffic from runningdefault.jsusingsudo tcpdump -i lo0 -w default.pcapunified.pcapcaptured network traffic from runningunified.jsusingsudo tcpdump -i lo0 -w unified.pcapdefault.logtext log ofdefault.js's payload contents generated usingtcpdump -r default.pcap -X > default.logunified.logtext log ofunified.js's payload contents generated usingtcpdump -r unified.pcap -X > unified.log