Phpmemcached extended timeout

Source: Internet
Author: User
When memcached extension is used in php to access memcached, when the memcached server fails to connect normally, the request response will be slowed down by default. Note: the network cannot be normally connected

When memcached extension is used in php to access memcached, when the memcached server fails to connect normally, the request response will be slowed down by default. Note: abnormal connection refers to a network failure. for example, if two servers cannot communicate with each other, the memcached service will not affect the response time even if the memcached service is not enabled or down, only memcached has no function.

The timeout time is controlled by the constant Memcached: OPT_CONNECT_TIMEOUT. the default value is 4000 milliseconds (1000 on the php official website, and 4000 on both 1.0.2 and 2.0.1 ). In addition, 1.0.2 and 2.0.1 are quite different. 1.0.2 when the addServer is executed, it will connect to the memcached server, and it takes two times the timeout time to execute the command. when memcached cannot be connected, it takes three times the timeout time.

2.0.1 in php 5.2 seems to have a bug, can not be used, see: https://bugs.php.net/bug.php? Id = 61283.

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.