I have a small intranet app which runs php and uses mysql to push data.
One the whole it works ok. Every so often i get massive cpu usage on mysql process around 98/% for a few mins.
I know you can check the slow query logs and i have and i seem some culprits.
It will take some time to rewrite these queries written by my predecessor is there anything i can do in the short term to alleviate the problem.

The server running this is a 32 bit ubuntu server with 4gb ram.
Moving forwards my plan is to migrate to a 64bit vm with more ram etc. But for now this is what i have to work with.
The pages serve around 10-15 users max.



Some log info

Click image for larger version. 

Name:	Capture.PNG 
Views:	4 
Size:	10.3 KB 
ID:	16073Click image for larger version. 

Name:	Capture..PNG 
Views:	5 
Size:	61.4 KB 
ID:	16074Click image for larger version. 

Name:	Capture.PNG 
Views:	4 
Size:	10.3 KB 
ID:	16073Click image for larger version. 

Name:	Capture..PNG 
Views:	5 
Size:	61.4 KB 
ID:	16074
Click image for larger version. 

Name:	sql space.PNG 
Views:	2 
Size:	3.1 KB 
ID:	16075
Click image for larger version. 

Name:	memory 2.PNG 
Views:	2 
Size:	3.9 KB 
ID:	16076


Many thanks