會是什麼原因導致session_start啟動慢。
PHP初次開機session_start非常慢。(等好幾分鐘)
用戶端有產生PHPSESSID COOKIE後訪問速度就恢複正常。
把PHPSESSID COOKIE刪除後開啟又很慢了,當首次開啟完成組建PHPSESSID後又恢複正常。
就這麼兩行代碼:
session_start();
phpinfo();
?>
會是什麼原因導致session_start初次開機這麼慢?
排查了很多的地方沒找到原因……
------解決方案--------------------
首次 ???
再次吧?
------解決方案--------------------
沒遇到過,多用幾個瀏覽器測試看看。
------解決方案--------------------
4.6 min?...內牛滿面....
------解決方案--------------------
不知道這文章能解決你問題否:
http://www.daimami.com/operating-system/501202.html
------解決方案--------------------
引用手冊上的,不知道對不對題目
引用
There are some posts around about session_start() beeing terribly slow on ntfs. for me the problem occured from one day to another, system was already running fine for 2 years.
to get around it implementing a custom session_set_save_handler could be an option, although for me it worked just to put a session_write_close() somewhere near the end of my script. (maybe IIS didn't kill the php-threads fast enough?!)
------解決方案--------------------
繼續手冊上與“slow”相關的:
A note on Windows installations with an NTFS file structure:
Make sure you give your Internet user account (usually IUSR_MACHINENAME) "Modify" access to the session.save_path directory. Otherwise session_start() will silently - and oh, so slowly - fail.
("Modify" is a Win2k term, but the concept translates to older IIS installs).
------解決方案--------------------
引用:
PHP初次開機session_start非常慢。(等好幾分鐘)
用戶端有產生PHPSESSID COOKIE後訪問速度就恢複正常。
把PHPSESSID COOKIE刪除後開啟又很慢了,當首次開啟完成組建PHPSESSID後又恢複正常。
就這麼兩行代碼:
session_start();
phpinfo();
?>
會是……
同樣的代碼我在linux下測試沒有這個狀況.
所以你該考慮得問題應該是windows的問題,而不是php的問題.
------解決方案--------------------
如果你用linux出現這個問題的話,那麼比較簡單了,安裝一個mrtg檢測一下CPU,IO,磁碟,記憶體等等的使用狀況就好了,這樣你就能通過這個值瞭解到究竟是哪裡導致此問題的發生.
------解決方案--------------------
重編譯下或者換個版本?