I am using a VPS which is running 5 php scripts on a minute by minute basis using cron. Each script, itself, loops to execute a mysql query then sleeps for between 5 and 15 seconds. They all terminate after a minute of execution - and are then triggered back into life by the cron. The queries are to determine the kind of activity taking place and then they may take some sort of related action.
The hosting company tells me that this is using too much resource and is impacting other users. Whilst the queries run frequently, they are not supposed to be burdensome. What is the best way to monitor how much resource each script is using? I have shell access but I do not see them in the ps -A or in top.
Help appreciated
top
while they really running. After all they are executed, so they should be mentioned in the output oftop
. Did company tell you which resources - CPU? RAM? There is memory-get-usage function. For CPU I would watchtop
more carefully.