Skip to content

Instantly share code, notes, and snippets.

View RDux's full-sized avatar

RDux

  • Norwegian Polar Institute
  • Frozen Reindeer Country
View GitHub Profile
@RDux
RDux / README.md
Last active October 1, 2020 07:47
Basic GridFS operation that illustrates excessive memory usage in the official driver.

Description

Opening a mp4 video from GridFS leads to excessive memory usage after a few concurrent calls. The video in question is 43276570 bytes in size. I mention video because it was the scenario that caused me to notice the problem initially, however I think it's fair to assume the results will be the same regardless of what content you are loading.

It wasn't hard to spot something was going on since I noticed 100MiB+ of memory was being used after opening the video twice in different browser tabs. To get a feel for the gravity of the issue I ran a siege benchmark with 50 concurrent users.

siege -c 50 -r 1 'http://localhost:8080/'