数据库连接 占用资源到底有多大呢?
php中的 mysql_connect
如果是这样
连接,关闭   连接,关闭  连接,关闭  连续三次 比一次影响大吗?

解决方案 »

  1.   

    thread_cache_sizeHow many threads the server should cache for reuse. When a client disconnects, the client's threads are put in the cache if there are fewer than thread_cache_size threads there. Requests for threads are satisfied by reusing threads taken from the cache if possible, and only when the cache is empty is a new thread created. This variable can be increased to improve performance if you have a lot of new connections. Normally, this does not provide a notable performance improvement if you have a good thread implementation. However, if your server sees hundreds of connections per second you should normally set thread_cache_size high enough so that most new connections use cached threads.