Posts

, ,

Script to monitor server total file amount and send e-mails

If you are using an usual hosting or VPS you probably have limit of about 1 mln or eg. 0,5 mln of files (iNODEs). It’s crucial to monitor amount of files especially if you have a lot of aplications generating cache or session files. Hosting providers not always has such monitoring systems, so when you reach the limit hosting will be automaticly blocked and in most cases you cant even login to your admin panel if it’s on the same virtual account.

I wrote short script to count files on your server, check if its exceeds limit and eventualy sends e-mail with warning.

Put it as eg. count_files.sh as low directory as possible eg. “/” for VPS or in /home/username/ directory for standard hosting.

 

,

How to test performance of VPS, Cloud or dedicated server?

When it comes to choose the right VPS or dedicated server for your solution, you may want to test its performance.

Some time ago, I stood before such choice. To optimize the testing process, I wrote a bash script for Ubuntu distributions based on SysBench.

  • You can also use it to test performance of any PC machine.
  • You will need root access.
  • Script will perform CPU, I/O and MySQL performance test, ten times each, so it should be 30 log files to take medium values and comapre with other machines results

 

Related links:

 

I’m not a specialist in linux bash so if you spot a mistake, you have questions or suggestions feel free to write a comment below!