You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And separately from that, potentially allow floats for ttls in addition to integers.
Internally, APCu currently uses time_t. I believe this means that a key will expire at X seconds and .000000000 nanoseconds.
i.e. currently, if I set a key with a TTL of 100 seconds at time X.123, then APCu stores it with an expiry of (X+100).000 with no fractional seconds, but I'd want it to expire closer to (X+100).123 instead
This would mean that for an application with a lot of frequently accessed, short lived keys backed by some (potentially slow) external service or db, there'd be a lot more requests to the external service at X.0 seconds than at X.5 seconds than at X.9 seconds , and if there's a bottleneck in the external service, requests at X.0 seconds would take longer to complete than requests at X.9 seconds.
There's potentially workarounds such as storing the pair [$value, float $ttl] in apcu_store instead of just $value (or raising ttls) but that would not be as efficient as a native solution
Compared to when APCu was initially published in 2013, or APC in 2003
PHP 7/8 is much faster than PHP 5 and has much lower memory usage per process
Server CPUs can have many more cores
CPUs have higher clock speeds and more ram
This can be done with gettimeofday and by changing times to be int64 and tp.tv_sec * 1000000 + tp.tv_usec
The text was updated successfully, but these errors were encountered:
And separately from that, potentially allow floats for ttls in addition to integers.
Internally, APCu currently uses time_t. I believe this means that a key will expire at X seconds and .000000000 nanoseconds.
X.123
, then APCu stores it with an expiry of(X+100).000
with no fractional seconds, but I'd want it to expire closer to(X+100).123
insteadThis would mean that for an application with a lot of frequently accessed, short lived keys backed by some (potentially slow) external service or db, there'd be a lot more requests to the external service at X.0 seconds than at X.5 seconds than at X.9 seconds , and if there's a bottleneck in the external service, requests at X.0 seconds would take longer to complete than requests at X.9 seconds.
[$value, float $ttl]
in apcu_store instead of just $value (or raising ttls) but that would not be as efficient as a native solutionCompared to when APCu was initially published in 2013, or APC in 2003
This can be done with gettimeofday and by changing times to be
int64
andtp.tv_sec * 1000000 + tp.tv_usec
The text was updated successfully, but these errors were encountered: