-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to using predis to interact with redis #24033
Conversation
I'd like to see performance comparison between the native and the php implementation |
@cmonteroluque @karlitschek this change has impact on all our packaging efforts - the php-redis extension can be dropped if this works out. |
@DeepDiver1975 https://github.com/nrk/predis/blob/v1.0/FAQ.md#speaking-about-performances TL;DR: With the phpiredis native PHP extension to help with serializing/unserializing data, it has near-identical performance to phpredis. Without the native helper extension, is about 3x slower (in terms of access latency to a remote Redis server). However, the scale at which the test was performed far exceeds anything we'd ever use it for: 0.132 seconds to fetch 30000 keys. So in summary, I'm highly in favour of this, but we should probably also package the phpiredis extension for enterprise users who need all the performance they can get. |
nice. Also copying @jnweiger |
I know this one - I still want to see how this performs in our usage scope |
I like dropping of external dependencies. This is always great. So we would need some real world performance tests and go with the php based solution or stick with the php extension. But not both please. |
Fixes: #21521 |
@Xenopathic obsoletes #23204 ? |
@butonic Yes, it does (just need to document how to configure a cluster) |
This is the worst case redis usage I can think of within our usage with thousands locking operations in a single request. For more "normal" cache/locking usage (regular propfind/get/put requests) I couldn't measure any significant difference between the two redis implementations since we usually any make a handful of redis calls The redis operations are about 2-2.5 times slower against a local redis instance without using the phpiredis extension, as the predis docs say the added php overhead quickly becomes less significant when taking into account real life setups where redis is not local. |
@icewind1991 Was that trace with the phpiredis extension? |
No, just plain ol php |
So with one of the worst possible situations, we add an extra 625ms on to the request. Nice! |
@karlitschek @DeepDiver1975 are the results acceptable ? |
@icewind1991 can you please elaborate on the test scenario you used for generating the graphs? THX |
I'm ok with this once @DeepDiver1975 is. |
running the file scanner on a folder with ~2k files |
what as the difference in execution time? THX |
conflicting ... |
rebased
As the trace says ~30%
When running against a redis server on the LAN I get about a ~7% performance decrease (again without using php extension for speedup) (note again that this is ~7% in a worse case scenario, for regular requests there is no measurable difference) |
30% of 10 hrs or 10% of 10 minutes - this is what I looking for 😉 |
The absolute time is a fairly useless metric here, it all depends on how large the folder is you're scanning |
What are the reasons for adding this besides the cluster support? |
|
relevant of us currently?
for sure not |
laravel\queue requires it for it's redis backend |
Okay - but there is currently no need in storing the job Queue in redis. Pure DB based jobqueue is all we need for now. |
using laravel's queue with the db backend pulls in laravel's db layers with it from what I can tell so that would not be optimal, but that's a separate discussion that shouldn't take place here |
Using predis would remove some ugly php-redis dependencies for suse and redhat builds. @jnweiger may have more details. But my take is that predis is great because it works out of the box. No need to use pecl. If you really need that extra bit of performance add the drop in c bindings. Very elegant. Sorry for picking the wrong lib in the first place. |
It's generally hard to declare something to be a wrong decision - there are always pros and cons ... |
this was my very first comment as we have been chatting about this some days back .... |
So currently I see no hard requirement to change the library (yes there are reasons which might let predis appear to look more elegant - but we have no hard requirement to change) and given the fact that we (as in I who has to make the decision) cannot fully judge the impact as of now and it appears to have a potential performance drawback I advise against this change. @karlitschek @cmonteroluque |
Packaging issues are actually the bigger problem for our customers that have to stick to rhel or suse. |
From my understanding this has already been taken care of in most cases ... and if not it has to be taken care of because all installation using 8.2 and 9.0 need the extension any how. |
Discussed a bit with @MTRichards and @cmonteroluque I think this is an interesting direction and something to investigate. I think the consensus is to not actively switch to this in the 9.1 timeframe. Mainly because there is: 1. no burning need for it at the moment. 2. there is always the risk to break stuff and running into new bugs when switching do a different library. 3. Already tooo much stuff to do for 9.1 Search for example. I hope this makes sense. |
moving to backlog because of the reasons above |
https://software.opensuse.org/download.html?project=isv%3AownCloud%3Adevel&package=php5-redis What is the planned deployment method for predis? Do we include the code as 3rdparty? I see packages libphp-predis / php5-pear-nrk-Predis on many more platforms compared to php5-redis. If we include the code, we should check there is no conflicts / confusion with preinstalled packaged/predis versions. |
Hm, then we need to reevaluate #23204 for redis cluster support, another thing this would have solved. Or in the spirit of the Manifesto for Agile Software Development: Since kibana uses predis this PR will cause less trouble in the future compared with #23204 |
see #23204 (comment) |
@icewind1991 closing this for now - THX |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Use predis instead of the php-redis extension, predis is a pure php implementation of redis so it does not require any php extension to be installed.
Additionally predis seems to be more widely supported by 3rdparty stuff so using it ourselves makes it easier to integrate 3rdparty libraries that use redis.
Supersedes #23999
Requires owncloud-archive/3rdparty#273
cc @PVince81 @Xenopathic