PHP page has a browse count of 200 concurrent per second, resulting in the insert to the MySQL caused a lot of pressure
LNMP environment, the other page content has done a cache, not much load, is the number of browsing statistics function, to the MySQL bring great pressure, I ask you what solution?
How to say do not use MySQL to do, 200 concurrency per second is not difficult for MySQL AH. and replaced by Redis, Memcached, not to mention the persistence, business code and Operation dimension deployment is not small.
I'll give you some advice and try to make your operational deployment and business code smaller.
You can be the master from the separation, do not in a library high concurrent inserts also do a lot of statistical operations. After separation, the query is done from the library (or even into specialized distributed systems such as Hive), and the index can be removed from the main library to promote the performance of the insert. This method, the business code is almost no change (change the database configuration file is good). MySQL operation-dimensional deployment can also choose a business trough online to do.
If you can accept a small amount of business code (PHP) changes, there are two suggestions:
1. Sub-Library, table, the total amount of data per table is small, the operation of the performance will be better, especially for the MyISAM from the library table. You may have some queries before you insert, such as querying this IP in the library, not before.
2. Use the Handlersocket plug-in to bypass the SQL Parser and directly manipulate the storage files. You can also use BULK Insert (BULK INSERT) if possible on the business. MySQL InnoDB also launched a similar handlersocket InnoDB NoSQL Plugin, with the memcached protocol, sharing InnoDB Buffer, No longer have to worry about how MySQL and memcached maintain data consistency.