Giter Club home page Giter Club logo

Comments (2)

beryllium avatar beryllium commented on August 26, 2024

The reason I initially went with fsockopen() was that connection attempts via Memcache have a default timeout of 1 second. I was aiming for sub-second page loads, even when the memcache server is offline, and fsockopen() allows me to set a Millisecond-level timeout. I see that Memcache::addServer has a timeoutms value now, but its location at the end of the function definition might make it a bit useless - you're welcome to experiment with that, though.

I did some quick benchmarks:

  • Blindly trying to add a value to the (offline) server takes 1.022 seconds
  • Using getServerStatus first takes 1.024 seconds
  • Using fsockopen() with a 0.2s timeout takes 0.22s to determine the server is offline & ignore the request.

It might make more sense to put an "@" suppression flag on the calls to fsockopen/fclose; given that these methods are supposed to detect and ignore a timeout, the notice itself is fairly irrelevant.

from cachebundle.

jeremylivingston avatar jeremylivingston commented on August 26, 2024

The interesting thing that I found about getServerStatus() is that you have to have the server added first.

I don't actually think there's a way that we could take advantage of this function to do what the bundle is doing. Once a server is added to the pool, it seems that there's no way to remove it, so is getServerStatus() more of an awareness thing? It seems that calls to get() and set() would still fail once the server is added.

Thanks for merging the PR. This will help calm the noise in my logs right now.

from cachebundle.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.