It is fairly easy to create a long running server in a GC'd language that will continually consume more memory. Some don't like to call it a memory leak, which is why I put it the way I did, but the effect is the same.
At the end of the day, the more that you think this is impossible the more likely your programs will experience it. So please don't think that your program is immune to this because you use Javascript.
Good example might be a server process which never releases memory, so the longer it runs the more memory it "consumes". That is, the maximum memory required to handle any previous request.
This might be a well known solved problem, but I have heard it mentioned before.
I have an apache box that runs a bunch of PHP and flat HTML sites. I have to set it to only use 10 processes, and to kill them every half hour, because they all gradually swell up to 35MB each (which I imagine is where they've loaded pretty much all the PHP on my server, independently of each other).
Without the number limit, or the kill policy, the server runs out of RAM and crashes. (it's only a cheap one, with 512MB RAM.) Luckily it's a very low traffic set of sites, so these limits don't break the experience. I'm glad I didn't have to solve this problem any deeper!
Have you enabled the GC? Some default configs disable the PHP GC because it's SOP to run temp startups (eg mod_php) or restart them on a regular basis (like you).
I haven't had to log in for a while (about a year), so I've been happy to leave it as it is. When I migrate over to DigitalOcean (which I've been intending to do for ages now) I'll look into that instead!
Comments
It is fairly easy to create a long running server in a GC'd language that will continually consume more memory. Some don't like to call it a memory leak, which is why I put it the way I did, but the effect is the same.
At the end of the day, the more that you think this is impossible the more likely your programs will experience it. So please don't think that your program is immune to this because you use Javascript.
Good example might be a server process which never releases memory, so the longer it runs the more memory it "consumes". That is, the maximum memory required to handle any previous request.
This might be a well known solved problem, but I have heard it mentioned before.
I have an apache box that runs a bunch of PHP and flat HTML sites. I have to set it to only use 10 processes, and to kill them every half hour, because they all gradually swell up to 35MB each (which I imagine is where they've loaded pretty much all the PHP on my server, independently of each other).
Without the number limit, or the kill policy, the server runs out of RAM and crashes. (it's only a cheap one, with 512MB RAM.) Luckily it's a very low traffic set of sites, so these limits don't break the experience. I'm glad I didn't have to solve this problem any deeper!
Have you enabled the GC? Some default configs disable the PHP GC because it's SOP to run temp startups (eg mod_php) or restart them on a regular basis (like you).
ooh, no, thanks for the tip :)
I haven't had to log in for a while (about a year), so I've been happy to leave it as it is. When I migrate over to DigitalOcean (which I've been intending to do for ages now) I'll look into that instead!
If you just set MaxRequestsPerChild to something pretty low that will cause them to restart on their own pretty frequently.