會是什麼原因招致session_start啟動慢

來源:互聯網
上載者:User
會是什麼原因導致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,磁碟,記憶體等等的使用狀況就好了,這樣你就能通過這個值瞭解到究竟是哪裡導致此問題的發生.
------解決方案--------------------
重編譯下或者換個版本?
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.