What causes slow start of session_start?

Source: Internet
Author: User
What causes slow start of session_start. It is very slow for PHP to start session_start for the first time. (Wait for several minutes) after the client generates PHPSESSID & nbsp; COOKIE, the access speed will return to normal. Why does it cause slow start of session_start when PHPSESSID & nbsp; is opened after the COOKIE is deleted.
It is very slow for PHP to start session_start for the first time. (Wait for several minutes)


After the client generates the phpsessid cookie, the access speed returns to normal.
After the phpsessid cookie is deleted, it becomes slow again. after the PHPSESSID is generated for the first time, it becomes normal again.

There are two lines of code:

Session_start ();
Phpinfo ();

?>

What causes the slow start of session_start for the first time?
I found many issues and found no reason ......
------ Solution --------------------
First time ???
Again?
------ Solution --------------------
I have never encountered it. I want to test it in a few more browsers.
------ Solution --------------------
4.6 min ?... Inniu's face ....
------ Solution --------------------
I don't know whether this article can solve your problem:
Http://www.myexception.cn/operating-system/501202.html
------ Solution --------------------
I don't know if it's correct to reference the manual.
Reference
There are some posts around und 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 cocould 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 ?!)

------ Solution --------------------
In the continued manual, "slow" is related:

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 instils ).
------ Solution --------------------
Reference:
It is very slow for PHP to start session_start for the first time. (Wait for several minutes)


After the client generates the phpsessid cookie, the access speed returns to normal.
After the phpsessid cookie is deleted, it becomes slow again. after the PHPSESSID is generated for the first time, it becomes normal again.

There are two lines of code:

Session_start ();
Phpinfo ();

?>

Yes ......

I tested the same code in linux.
Therefore, you should consider windows, not php.
------ Solution --------------------
If this problem occurs in linux, it is easy to install a mrtg to check the usage of CPU, IO, disk, memory, and so on, in this way, you can see through this value where this problem occurs.
------ Solution --------------------
Re-compile or change the version?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.