Portal Home > Knowledgebase > Articles Database > Script for monitoring Apache & Mysql


Script for monitoring Apache & Mysql




Posted by Cameleon, 03-04-2010, 04:52 PM
As in title, are there any scripts for monitoring 24h so that i would tweak httpd.conf and my.cnf for mysql ? Thx in advice.

Posted by SC-Daniel, 03-04-2010, 04:55 PM
So you are looking for a script that automatically tweaks my.cnf and httpd.conf based on the current MySQL and Apache stats? I do not believe one exists, to be honest... What metrics are you wanting to measure/monitor?

Posted by Cameleon, 03-05-2010, 10:17 AM
Nope i will tweak by myself. Well ram, cpu - are main to be under monitoring process. There where some script to monitor and tweak mysql but can't remember now where. Last edited by Cameleon; 03-05-2010 at 10:28 AM.

Posted by Johnny Cache, 03-05-2010, 10:30 AM
top' will show you just about everything you'd need to monitor system resources. Typing 'SHIFT + M' will show you what processes are using the most resources from top to bottom. As far as monitoring MySQL processes, I just tried this on my QA server. Is this what you're looking for?

Posted by Johnny Cache, 03-05-2010, 10:35 AM
The only other thing I can think as far as "Tweaking" MySQL would be this section of the php.ini file (and please, make a second copy of it before you start changing the file.

Posted by Cameleon, 03-05-2010, 12:56 PM
bombastic fantastic, thx guys. if anyone can post something more would be gratefull.

Posted by Cameleon, 03-05-2010, 01:54 PM
What about Apache, that is what i need to tweak > relevant to cpu and mem usage.

Posted by inspiron, 03-05-2010, 06:41 PM
Top command will show the processes consuming disk usage. You can check the mysql processes using #mysqladmin processlist

Posted by Johnny Cache, 03-05-2010, 07:00 PM
Ahh, Apache... RLimitMEM and RLimitCPU values in httpd.conf should be just what you need. The below links will guide you through limiting the amount of resources Apache can use. http://httpd.apache.org/docs/2.2/mod...html#rlimitmem http://httpd.apache.org/docs/2.2/mod...html#rlimitcpu If you want to go further, you can also add an RLimitNPROC directive to your httpd.conf file. But before making any changes, copy the file to httpd.conf.bak or something, just to be on the safe side. Good luck! Last edited by Johnny Cache; 03-05-2010 at 07:03 PM.

Posted by maroonhost, 03-05-2010, 07:03 PM
use this command to see the nubmer of connections made to the webserver (apache) in real time

Posted by Johnny Cache, 03-05-2010, 07:06 PM
I believe you're thinking of the 'df -h' command to display HDD consumption. top - 15:07:59 up 12:38, 5 users, load average: 0.03, 0.03, 0.00 Tasks: 108 total, 2 running, 106 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 3537920k total, 2104896k used, 1433024k free, 403360k buffers Swap: 3903752k total, 0k used, 3903752k free, 1103096k cached

Posted by WebSliceNZChris, 03-05-2010, 08:21 PM
So if I understood this correctly, you want to monitor apache and mysql so that depending on the load/usage you would tweak the conf files?

Posted by Johnny Cache, 03-06-2010, 03:41 PM
This is located in httpd.conf as well. If you can find this section in there, add your IP to "Allow from" and then browse to http://hostname.yoursite.com/server-status and you'll then have access to the Apache stats. Example would look like this: (I had to crop this big time) http://nwtechgroup.com/WHT/httpd_server-status.png



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
limestonenetworks down (Views: 747)


Language: