I have this LAMP application with about 900k rows in MySQL and I am having some performance issues.
Background – Apart from the LAMP stack , there’s also a Java process (multi-threaded) that runs in its own JVM. So together with LAMP & java, they form the complete solution. The java process is responsible for inserts/updates and few selects as well. These inserts/updates are usually in bulk/batch, anywhere between 5-150 rows. The PHP front-end code only does SELECT’s.
Issue – the PHP/SELECT queries become very slow when the java process is running. When the java process is stopped, SELECT’s perform alright. I mean the performance difference is huge. When the java process is running, any action performed on the php front-end results in 80% and more CPU usage for mysqld process.
Any help would be appreciated.
MySQL is running with default parameters & settings.
Software stack –
- Apache – 2.2.x
- MySQL -5.1.37-1ubuntu5
- PHP – 5.2.10
- Java – 1.6.0_15
- OS – Ubuntu 9.10 (karmic)
We’d need to know a lot more about the system to say if thats normal or how to solve the problem.
I would say that makes it very small – so if its performing badly then you’re going seriously wrong somewhere.
Enable the query log to see exactly what queries are running, prioritize based on the product of frequency and duration. Have a look at the explain plans, create some indexes. Think about splitting the database across multiple disks.
HTH
C.