Wednesday, May 11, 2016

GNU/Linux - maxload in fight with overload

Your server is too busy?
You have problem with overload?
You want use CPU resource more effective?

If your answer is YES, maybe you are interested maxload. maxload allow you to run a very intensive task which can be paused and protects your server from overload.

Suppose your Linux server consumes 40% of CPU resource. So you have reserve of 60%. You want use from it but you worry about overload because you don't have control over how much your task will use of CPU resource. maxload resolves this problem and give you possibility to use your CPU say in 99%.

Example
You have very large folder and you must create a backup for this files. This is a very intensive task for CPU and disk. So you create a script like below.

cat backup.sh
#!/bin/bash
tar -cjpf /root/backup/site_file.tar.bz2 /var/www/html/example.com/public_html

Next what you do is run it via maxload and set correct border value for maxload. Suppose your server has 4 CPU cores visible in operating system. So if you want use ~90% of CPU you must set max border on 3.6.

maxload 3.6 /root/backup/backup.sh

More about maxload you can read in GitHub.


No comments:

Post a Comment