jaymc Posted July 29, 2008 Share Posted July 29, 2008 My server is swapping 1.4GB I have a total of 3GB on the server I know most of it is because of mysql, if I restart apache it drops 200MB so the rest must be mysql The funny thing, it is not impacting performance at all. The server is pretty busy, yet my load averages are always around 0.9 and CPU 30% In the past 500MB swap has killed my server off, so why is 1.4 sitting nicely on my disk yet not impacting the server Infact, its probably running better than it ever has! Quote Link to comment https://forums.phpfreaks.com/topic/117129-solved-swap/ Share on other sites More sharing options...
trq Posted July 29, 2008 Share Posted July 29, 2008 The Linux kernel is designed in such a way that it actually uses (or attempts to) what memory and swap it is allocated, generally there is no harm in it Quote Link to comment https://forums.phpfreaks.com/topic/117129-solved-swap/#findComment-602497 Share on other sites More sharing options...
jaymc Posted July 29, 2008 Author Share Posted July 29, 2008 But surely using disk is not good Is it saying my system beeds 3GB + 1.4GB In other words, I need more memory!! Or, its using it because its their Quote Link to comment https://forums.phpfreaks.com/topic/117129-solved-swap/#findComment-602511 Share on other sites More sharing options...
corbin Posted July 29, 2008 Share Posted July 29, 2008 (This entirely piggy-backs on thorpe's answer ;p) I'm not sure if this is how the Linux kernel works, but as far as the Windows kernel goes, [assuming I remember correctly], this is the order in which memory is used: -All available RAM will be assigned first -If a program requests memory, memory from an inactive program may be moved to the swap file -Things will not be removed from the swap file until it is either cleared, or the space is needed So, pretty much it uses it because it can. Also, just because the data is there doesn't mean it's actively using it. It could be there 'just in case' it's needed later. And, just because 1.4GB of the swap file is used, that doesn't mean all of the RAM is used, and even if all of the RAM is used, that doesn't mean that at that point in time, no RAM is available to be cleared up. Memory on computers is a strange thing. Quote Link to comment https://forums.phpfreaks.com/topic/117129-solved-swap/#findComment-602865 Share on other sites More sharing options...
jaymc Posted July 29, 2008 Author Share Posted July 29, 2008 I see, so the memory has been allocated and is stored on that disk, but its not being actively read/written to I guess when it is, thats when to worry Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/117129-solved-swap/#findComment-603160 Share on other sites More sharing options...
corbin Posted July 30, 2008 Share Posted July 30, 2008 Exactly ;p. Quote Link to comment https://forums.phpfreaks.com/topic/117129-solved-swap/#findComment-603286 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.