Current time: 04-19-2014, 03:06 PM Hello There, Guest! (LoginRegister)

Post Reply 
"We had to reboot your VPS"
02-22-2012, 10:13 AM (This post was last modified: 02-22-2012 11:09 AM by jon-).)
Post: #11
RE: "We had to reboot your VPS"
Thanks for the reply. It does sound a very clever approach, and the only thing that I can think of that might be a problem is if actual memory usage on the server is higher than I expected at the time the script was run. The script would have to check if there was a enough free memory before running that process.

e.g. if max memory was set at 2 GB and was temporarily 1400 MB. If it then tried to run a 1000 MB process, the server might be forced into a reboot by DreamHost's process killer because it would exceed the memory on the server. The script should only run if there is enough free memory to run the process (sounds obvious, but if it's automated, there's potential for a problem).

EDIT: Maybe something it could do in future is detect the amount of cached memory being used on the server and allow you to use a configurable percentage of that for the process. Then, when the script is run it should never cause an OOM issue on the server and will always reduce the cache by that percentage (the percentage could be set higher or lower depending on how aggressive you want the script to be).
Visit this user's website Find all posts by this user
Quote this message in a reply
02-22-2012, 11:26 PM
Post: #12
RE: "We had to reboot your VPS"
Yes, those are the kind of checks that would happen once I've integrated it into PsManager - it would basically work out how much the cache must be reduced by in order for a resize to happen without a reboot.

Like I said, this was a program I wrote to test this concept for cache reduction. In the state the program is in now you'll have to check yourself how big the cache is before running it. You can run it with other values than 1000, it's up to you exactly how much. If your server is constantly using below 600 MB and you have 2000 MB it makes sense to reduce it a bit. If it sometimes uses 1400 MB then maybe it does not make sense to reduce it in the first place.

Otto - 7is7.comDreamhost VPS ManagerDreamhost Promo Codes
Visit this user's website Find all posts by this user
Quote this message in a reply
02-23-2012, 02:30 AM (This post was last modified: 02-23-2012 05:48 AM by jon-).)
Post: #13
RE: "We had to reboot your VPS"
No worries, I think what you've come up with is very useful, and it was just meant as feedback in case you ever decided to do something more with it.

This whole issue is just making me think it's ridiculous to always have this money/memory battle. The cost I am paying right now for VPS is more than a dedicated server would be with quadruple the amount of RAM (I'm using 2GB a month on a web PS, plus 800 MB on a MySQL PS), so it's probably time I switched to dedicated hosting...
Visit this user's website Find all posts by this user
Quote this message in a reply
01-24-2013, 08:59 AM
Post: #14
RE: "We had to reboot your VPS"
Although this thread is a year old, I am curious to know if this clever work-around to clear the cache has already been implemented. I ask because I have noticed that the VPS where I have PSManager running have a strong dip in cached memory around midnight each night.

If this is indeed PSManager, then kudos!
Visit this user's website Find all posts by this user
Quote this message in a reply
01-24-2013, 05:11 PM
Post: #15
RE: "We had to reboot your VPS"
No, unfortunately that's still not included in PsManager. Mainly I am not quite happy with the hack and well I have been lacking time to experiment Undecided

The cache does appear to be cleared every now and then, for reasons I do not know, could be just the way the OS works, maybe clearing the cache of old stuff, or it's something that Dreamhost set up that way, maybe they do clear the cache on whole machines at set times. Strangely I haven't gotten much feedback from people running into this problem lately either.

Otto - 7is7.comDreamhost VPS ManagerDreamhost Promo Codes
Visit this user's website Find all posts by this user
Quote this message in a reply
01-11-2014, 09:24 AM
Post: #16
RE: "We had to reboot your VPS"
Sorry to bump this for another year, but it doesn't look like an API call or other solution has been implemented yet. I got a forced resize but then I have only just installed PSManager so it's not really surprising, but it drew me to this thread.

I did however think of a potential "clean" workaround for this issue; simply reduce the memory size over time. It seems that the cache memory won't completely fill the available free space (or at least it doesn't on my host), which means PSManager should be able to reduce the memory limit in small increments.

For example:
My total memory is 400mb, I have 75mb of actual usage and 313mb of cached memory, this gives a total of 388mb. If PSManager decides that my optimal amount is say, 290mb, then a resize straight to that amount is of course impossible, however if it requested a change to 390mb then that should work just fine. At this point the cache is uncomfortably large, so next time PSManager runs it will hopefully have reduced in size a bit more, allowing the limit to go down further.

Of course this runs the risk of hitting the 30(?) a day limit on changes, so PSManager would have to throttle how often it does this, but it should allow the limit to still ultimately work its way down over time. Your memory use "hack" could still be used to hurry this along, with appropriate user configuration options of course. This way it's possible to create a balance of trying to reclaim all the cache memory at once, or to do it in say… 32mb increments, or simply just whatever free memory is handy at the time; so long as the memory limit is working its way down as expected then PSManager shouldn't need to force a restart, unless the user's settings don't allow it any other choice.
Find all posts by this user
Quote this message in a reply
01-14-2014, 01:07 PM
Post: #17
RE: "We had to reboot your VPS"
(01-11-2014 09:24 AM)haravikk Wrote:  Sorry to bump this for another year, but it doesn't look like an API call or other solution has been implemented yet. I got a forced resize but then I have only just installed PSManager so it's not really surprising, but it drew me to this thread.

I did however think of a potential "clean" workaround for this issue; simply reduce the memory size over time. It seems that the cache memory won't completely fill the available free space (or at least it doesn't on my host), which means PSManager should be able to reduce the memory limit in small increments.

For example:
My total memory is 400mb, I have 75mb of actual usage and 313mb of cached memory, this gives a total of 388mb. If PSManager decides that my optimal amount is say, 290mb, then a resize straight to that amount is of course impossible, however if it requested a change to 390mb then that should work just fine. At this point the cache is uncomfortably large, so next time PSManager runs it will hopefully have reduced in size a bit more, allowing the limit to go down further.

Of course this runs the risk of hitting the 30(?) a day limit on changes, so PSManager would have to throttle how often it does this, but it should allow the limit to still ultimately work its way down over time. Your memory use "hack" could still be used to hurry this along, with appropriate user configuration options of course. This way it's possible to create a balance of trying to reclaim all the cache memory at once, or to do it in say… 32mb increments, or simply just whatever free memory is handy at the time; so long as the memory limit is working its way down as expected then PSManager shouldn't need to force a restart, unless the user's settings don't allow it any other choice.

This is what happens naturally already, memory will get reduced over time by PsManager, at least if usage doesn't increase in the meanwhile. In theory it could be possible to speed it up, but as you say, we then have the 30 resizes per day limit which might become an issue.

Otto - 7is7.comDreamhost VPS ManagerDreamhost Promo Codes
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: