I have a web application. bought a pretty strong server for it. Server specification is below: CPU: DUAL E5-2620 RAM: 32 GB DDR3 HDD: 2 x 300GB SAS 10K Network: 100mbps/10TB internet.
WebServer Specification: Apache/nginx/PHP Database: MySQL
Now my users are getting high day by day. My server is not tolerate such this pressure. and waiting time is getting high. So I thought about separating MySQL and Web server on two identical server to balance cpu load. Now I found out with separating mysql and php, I will have another below problems!
- Waiting on network transferring: I have such this MySQL query: "SELECT * FROM table" If the table has more than 500MB data. With my connection speed will take several seconds to get such table over network. and it's only for one user with one connection but it multiplies by 10 connections from one user and more than 100 online users.
Above example is just an example but real data shows below info for 100 online users at the same time:
Traffic + ø + per hour
Received + 14.7 GiB + 201.4 MiB
Sent + 429.4 GiB + 5.7 GiB
Total + 444.2 GiB + 5.9 GiB
So it seems separating is something impossible for my web application. Now I am stuck what to do to balance load onto these two servers without having such this big issue. What can be alternative way to balance my cpu load without have latency problem (at least with less problem)?
*****notice: query is an example. my queries are enough optimized but my application is so much more complicated hence have very much interacts with database. But mysql info shows still 6GiB data transferred.