Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Strange swap usage
- Server strangely is swapping as under
- ++++++++++++++
- list of top cheapest host http://Listfreetop.pw
- Top 200 best traffic exchange sites http://Listfreetop.pw
- free link exchange sites list http://Listfreetop.pw
- list of top ptc sites
- list of top ptp sites
- Listfreetop.pw
- Listfreetop.pw
- +++++++++++++++
- Code:
- mysqld 216128 kBclamd 13556 kB
- spamd 4628 kB
- cpanel_php_fpm 2048 kB
- memcached 1804 kB
- java 1580 kB
- tuned 120 kB
- httpd 116 kB
- httpd 116 kB
- httpd 116 kB
- httpd 116 kB
- httpd 116 kB
- httpd 116 kB
- httpd 116 kB
- while RAM usage is
- Code:
- # free -h total used free shared buff/cache available
- Mem: 125G 34G 4.2G 150M 86G 80G
- Swap: 2.0G 238M 1.8G
- and swappiness is
- Code:
- # sysctl vm.swappiness
- vm.swappiness = 10
- This happens when cPanel backup are running, however 60sec data capture shows at no point did RAM availability drop...
- https://imge.to/i/vdAP1G
- confused!
- Is it invoking the OOM killer (confirm via "dmesg") or is it just the kernel being egalitarian with how it maps file and anonymous pages in memory management? Unless you're having applications explicitly terminated by an emergency memory reclaim I wouldn't worry about it and let the experts that built Linux's memory management subsystem do its thing.
- instantmasti.com
- dinstudio.com
- e host catt sadler
- ghost forum
- host global forum 2020
- master-ptp.com
- yllix.com
- profile.empowr.com
- You have 80 GB of flex memory from that output.
- Linux Ate My RAM and In defence of swap are good reads on this topic.
- Apis Networks: engineered hosting
- vm.swappiness = 10 is fine.
- You can run the dynamic output of vmstat 1 on commadline, check 'swpd' utilization is high.
- #vmstat 1 #
- It is common to see that the SWAP memory is being used by few processes even if there is more than 30-50% of total physical memory is free, but it is something not to worry if the kernel is not triggering an 'OOM (Out of memory ) killer' on that specific time.
- From the log file, you can see if any OOM errors are triggered
- Run the following command on shell to see this.
- # egrep -i "OOM" /var/log/messages*
- The kernel migrates inactive pages into 'swap' in background, to free up the real RAM for more active data to be processed, when a heavy task is initiated. In similar conditions the kernel might occupy the SWAP space by skipping the available free RAM.
- TuxAndrew
- Linux - RedHat|cPANEL CentOS,Ubuntu |Azure-Vm/AWS-Ec2 Administrator,
- Assistance, Analysis and Diagnosis| Skype: tuxandrew
- tuxandrew@aol.com
- Also If we consider certain processes that was set with low memory limits, for those processes, the memory required might not be taken from the buffered, skip the free and taken from SWAP. May this can also explains what happened.
- Just quoting the typo:
- -----------------------------
- You can run the dynamic output of vmstat 1 on commadline, check 'swpd' utilization is high.
- Checked and it's all good. No OOM termination and now the swp usage is stationary.
- Wonder if there is any downside to turn swap off all together?
- Not actually happen for systems with high amount of free memory available and must be pretty sure that the system will always maintain more than enough physical RAM. The Swap is a virtual memory extension. On production servers, it is not a practice to disable the swap memory permanently.
- But clearing the swap temporarily is fine if the system has left with free memory() more than the SWAP.
- TuxAndrew
- Linux - RedHat|cPANEL CentOS,Ubuntu |Azure-Vm/AWS-Ec2 Administrator,
- Assistance, Analysis and Diagnosis| Skype: tuxandrew
- tuxandrew@aol.com
- Checked and it's all good. No OOM termination and now the swp usage is stationary.
- Wonder if there is any downside to turn swap off all together?
- The downside: Your server will crash, or even if it doesn't your services will sometimes stop or be killed and be completely unable to start again.
- Swap is a safety valve - it is there to permit your kernel to, literally, swap pages of RAM in and out of use. If it's not there and you run the box out of RAM (which will happen) then things die - and won't restart again because there won't be enough RAM available for them to run in. (MySQL I'm looking sternly your way, buddy)
- tl;dr --
- Having swap: Sometimes it'll be used and might slow things down.
- Not Having swap: Sometimes your server will explode messily
- Choose!
- "I've seen spam you people wouldn't believe. Routers on fire off the OCs of AGIS. I watched MXes burning in the dark near the Cyberpromo Gateway. All those moments will be lost in time, like tears in rain. TTL=0."
- The downside: Your server will crash, or even if it doesn't your services will sometimes stop or be killed and be completely unable to start again.
- Swap is a safety valve - it is there to permit your kernel to, literally, swap pages of RAM in and out of use. If it's not there and you run the box out of RAM (which will happen) then things die - and won't restart again because there won't be enough RAM available for them to run in. (MySQL I'm looking sternly your way, buddy)
- tl;dr --
- Having swap: Sometimes it'll be used and might slow things down.
- Not Having swap: Sometimes your server will explode messily
- Choose!
- Wow! could you clarify if "you run the box out of RAM" is a given then it is also a given that your box will run out of RAM+Swap. So the server will "explode messily" anyway as you said. So server "explode messily" can probably be delayed and not mitigated by creating swap, unless slowness due to swap usage is your method of warning system for server "explode messily"!
- We monitor RAM and Swap usage on 60 second intervals 24/7/365 with repeated alerts (email and sms) if the usage drosses 80% over a five min period. So unless we simply ignore the event alerts I don't see your downside happening. Adding swap just means clients complaining in addition to alerts, which if we don't act on alerts we probably won't act on client complaints (hope that never occurs).
- Wow! could you clarify if "you run the box out of RAM" is a given then it is also a given that your box will run out of RAM+Swap.
- Actually no.
- Processes start up and claim $X amount of RAM for their own purposes - but might not again touch that particular page or five of RAM for seconds, hours, days even. (Think: daemons starting at server start-up loading shared libraries and etc)
- Swap permits your kernel to recognize those claimed-but-not-used pages as exactly that and swap them out to disk. Still ready should they be needed by the process, but not consuming precious and finite RAM.
- Quote Originally Posted by WindsOfChange View Post
- So the server will "explode messily" anyway as you said. So server "explode messily" can probably be delayed and not mitigated by creating swap, unless slowness due to swap usage is your method of warning system for server "explode messily"!
- Without swap you actually accelerate how quickly your server can get into a high memory contention state or even OOM entirely - because now all RAM allocations are equally important and the kernel has less flexibility in its memory management - the stuff that isn't in use has just as much claim to RAM as the stuff that needs to be in use.
- Quote Originally Posted by WindsOfChange View Post
- Adding swap just means clients complaining in addition to alerts, which if we don't act on alerts we probably won't act on client complaints (hope that never occurs).
- Without swap space available your server is a ticking bomb - and when it goes off you will have no chance at all to get in and save it. With swap space, and the active monitoring of how much swap is being used, then when things do implode on you you'll have enough time, usually, to get in and salvage the situation before it's unrecoverable.
- "I've seen spam you people wouldn't believe. Routers on fire off the OCs of AGIS. I watched MXes burning in the dark near the Cyberpromo Gateway. All those moments will be lost in time, like tears in rain. TTL=0."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement