Comments (2)
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.
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)
- FilecacheClient is useless
- Add SASL support
- Add Logging to Memcache Client
- Touch&Gat HOT 2
- Multiget HOT 9
- MemcachedClient needed
- Use DI configuration instead of parameters HOT 1
- AppKernel vs. Composer update circular problem HOT 4
- The reserved indicator "@" cannot start a plain scalar HOT 4
- No obvious way to break the cache HOT 3
- Need interface to remove key from cache HOT 1
- Where can I ask questions about CacheBundle? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cachebundle.