Apache & MySQL Connection Setting


Apache
  1. 檢查Apache 版本及運行腳本
    httpd -v, httpd -l
  2. 設定Apache22/extra/httpd-mpm.conf
  3. 找到腳本設定
    
        StartServers          5
        MinSpareServers       5
        MaxSpareServers       10
        MaxClients            1000 (150改1000)
        MaxRequestsPerChild   2000 (0改2000)
  4. 重啟Apache
    

MySQL
  1. 找到my.cnf
  2. 在[mysqld]下加入 max_connections = 1000
  3. 重啟MySQL

參考
合理設置apache-httpd的最大連接數






PHP cURL POST IIS


使用PHP curl POST 給IIS時要把字陣列改成字串


原本
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array('foo' => 'bar'));

改成
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, 'foo=bar');

MySQL CAST String to Integer



SELECT * FROM table ORDER BY CAST(column, SIGNED) DESC;