About Predis and benchmarks: why a pure-PHP Redis client anyway?
As some of you might know I'm the author and maintainer of Predis, a pure-PHP client library for Redis. When I started this project back in mid-2009 Redis was a very young yet promising NoSQL key-value store with only three client libraries available for PHP (one of which was a C-based extension that eventually led to phpredis) offering support only for the Redis commands implemented at that time, and plagued by many bugs. Fast forward to date, and both Predis and phpredis are now the two most used, stable and up-to-date clients in PHP-land among the bunch available. Although it's mostly a one-man project, I'm very proud of the work behind its development and thankful for the contributions received from the community.
So why am I writing this blog post? To cut it straight to the point, I think there's sometimes a little misconception about the very reason for which Predis exists nowadays and Aleksey's recent blog post is offering me a good opportunity to clarify things a bit. Don't get me wrong he made various valid points, but what has actually caught my attention and prompted me to write this post is the very introduction:
As some of you may know, I’m crazy about speed. So when I saw that people were happily using Predis as their choice of PHP client for Redis, I was a bit confused.
Why use a client written in PHP for something that should be ‘fast’ like Redis?
That kind of defeats the purpose - unless you don’t really care about response times and scalability.
Predis was initially developed to fill the lack for a decent client library but turned into a more comprehensive solution allowing for maximum extensibility. In a sense, you may think of this library not only as a mere client for Redis but as a sort of framework (pass me the buzzword) with various building blocks that developers can leverage to create abstractions for features based upon Redis and expose them through a consistent interface. In my opinion a great example of such extensibility is the abstraction used to support Lua scripts exposing them as if they were common Redis operations such as GET or SET (and it works when using client-side sharding or master/slave replication too). Some parts were also reused to build a fully-asynchronous version of the client!
Obviously there's a price to pay for everything and, in our case, that price is a penalty in raw speed compared to a C-based extension due to the undeniable greater overhead of a pure-PHP implementation. You can mitigate part of this overhead by using PHP >= 5.4 (faster at method dispatching), an opcode cache (you should do that anyway on production servers) or even plugging in phpiredis for faster protocol (de)serialization, but in the end you are optimizing your stack on a single-server basis. You can have 5, 10, 100 servers hitting Redis for distributed operations: that's where Redis shines the best and that's why it's considered blazing fast. In such distributed scenarios, when one or more Redis instances are running on remote hosts, you will soon notice that most of the difference in speed is lost due to network round-trip times so you will be left for the most part with the inherent overhead of compiling the source code (or loading the cached opcodes) of Predis on each request. We've always been clear on what to expect out of Predis in this case and this is the reason why we have a FAQ about performances shipped along with the library. It's a matter of trade offs: you sacrifice a low overhead for the sake of flexibility.
But then again, is it possible to use Predis when you also need decent overall performances or scalability? Depending on your definition of "decent performances" in the context of your application and provided a correct setup and architecture, yes. I personally know of a few high-load web sites using Predis, each one with a different reason behind their choice. Sure, if you don't need fancy features and you only have one server performing requests against Redis running on the localhost then you would probably prefer to stick with phpredis thanks to its lower overhead, but that doesn't mean being able to scale. Is Predis better than phpredis, or the other way around? Simply put, they are two solutions to the same problem and both have their different strong and weak points. In the end you are the one to decide based on your needs but, more importantly and as Aleksey concluded, don't base your decisions on assumptions. And, I'd just like to add, not even on general benchmarks.
Itamar Haber ha detto:
26 maggio 2014 alle 12:38 · Rispondi a Itamar HaberTotally agree - performance isn't an absolute quality, but rather is derived from your requirements. BTW - Predis is a great Redis client, thanks for creating it!
Leandro ha detto:
19 novembre 2016 alle 7:46 · Rispondi a LeandroWhat's up colleagues, good paragraph and nice arguments commented at this place, I am truly enjoying by these.
migliori materassi ha detto:
30 novembre 2016 alle 12:24 · Rispondi a migliori materassiVery good post! We will be linking to this particularly
great article on our site. Keep up the great writing.
purificador de aire ha detto:
7 dicembre 2016 alle 10:20 · Rispondi a purificador de aireWonderful, what a weblog it is! This web site
presents helpful facts to us, keep it up.
mini four ha detto:
7 dicembre 2016 alle 14:39 · Rispondi a mini fourGood replies in return of this issue with genuine arguments and explaining the whole
thing on the topic of that.
tagliaerba elettrico opinioni ha detto:
9 dicembre 2016 alle 11:29 · Rispondi a tagliaerba elettrico opinioniIt's amazing to visit this web page and reading
the views of all colleagues concerning this article, while I am also eager of getting knowledge.
tritacarne ha detto:
14 dicembre 2016 alle 11:57 · Rispondi a tritacarneThat is a very good tip particularly to those fresh to the
blogosphere. Simple but very precise info… Thank you for
sharing this one. A must read article!
scaldasonno classifica del 2017 ha detto:
15 dicembre 2016 alle 4:15 · Rispondi a scaldasonno classifica del 2017It's remarkable in support of me to have a website, which is
beneficial in support of my experience. thanks admin
scopa elettrica ha detto:
26 dicembre 2016 alle 10:54 · Rispondi a scopa elettricaIt's amazing for me to have a site, which is good for my experience.
thanks admin
migliori saldatrici inverter ha detto:
26 dicembre 2016 alle 12:53 · Rispondi a migliori saldatrici inverterGood web site you have here.. It's hard to find high-quality writing
like yours these days. I seriously appreciate people like you!
Take care!!
migliori scaldabiberon ha detto:
27 dicembre 2016 alle 18:57 · Rispondi a migliori scaldabiberonHi there, just became aware of your blog through Google, and found that it's really informative.
I'm gonna watch out for brussels. I'll appreciate if you continue this in future.
Numerous people will be benefited from your writing.
Cheers!
regolabarba prezzo ha detto:
28 dicembre 2016 alle 19:22 · Rispondi a regolabarba prezzoI got this site from my pal who shared with
me on the topic of this web site and at the moment this time I am browsing
this site and reading very informative posts here.
portabici ha detto:
9 gennaio 2017 alle 7:47 · Rispondi a portabiciGood blog you have got here.. It's difficult to find high-quality writing like yours
these days. I seriously appreciate individuals like you!
Take care!!
macchina da caffe opinioni ha detto:
15 gennaio 2017 alle 1:40 · Rispondi a macchina da caffe opinioniWhat's up, this weekend is good for me,
as this point in time i am reading this impressive educational article here at my residence.
h samuel memory lockets ha detto:
19 gennaio 2017 alle 5:22 · Rispondi a h samuel memory locketsThis piece of writing presents clear idea in support of the
new visitors of blogging, that actually how to do running a blog.
lavapavimenti ha detto:
26 gennaio 2017 alle 22:01 · Rispondi a lavapavimentiHmm it appears like your website ate my first comment (it was extremely long) so I guess I'll just sum it up what I submitted and say, I'm thoroughly enjoying your blog.
I too am an aspiring blog writer but I'm still new to the whole thing.
Do you have any suggestions for newbie blog writers?
I'd definitely appreciate it.
meilleure cafetiere electrique 2017 ha detto:
15 febbraio 2017 alle 9:50 · Rispondi a meilleure cafetiere electrique 2017That is a good tip especially to those fresh to the blogosphere.
Short but very precise information… Thank you for sharing this one.
A must read article!
Mantiquegifts.com ha detto:
2 marzo 2017 alle 8:17 · Rispondi a Mantiquegifts.comThis site truly has all of the information I wanted concerning this subject and
didn't know who to ask.
yoga tees for girl ha detto:
2 marzo 2017 alle 14:51 · Rispondi a yoga tees for girlWhat's up, I would like to subscribe for this webpage to obtain hottest updates, therefore where can i do it please help.
accounting hoodies ha detto:
19 marzo 2017 alle 8:25 · Rispondi a accounting hoodiesFriday night's opening brought the Bluegrass stylings of Klinger-Mc - Fry, and Saturday will see
Borderline performing new and classic country.
A big part of Michael Jordan's income has been the Air Jordan brand,
the brand of shoes and athletic clothing designed, owned, and
produced by Michael Jordan for Nike's Jordan Brand subsidiary.
" Brady's post-season rep took a hit when the 18-0 New Englanders lost that '08 Super Bowl game to the New York Giants and the team proceeded to blow first-round playoff games in 2010 and 2011.
hot hoodies ha detto:
27 marzo 2017 alle 15:55 · Rispondi a hot hoodiesThese hoodies are NOT Tokyo Laundry branded - they are essentially promoting off overstock they have created for the likes of George at ASDA (whom
they manufacture "white label" clothes for)
female parent gift ha detto:
2 aprile 2017 alle 19:42 · Rispondi a female parent giftOn the web T-Shirt Shop, It gives a platform for T-Shirts Designers, T-Shirt Lovers & T-Shirt Buyers.
Increasing T-Shirt Designer Neighborhood contributing T-Shirt
Designs.Flaunt your taste and put on your imagination!
van dyk biography ha detto:
20 aprile 2017 alle 3:17 · Rispondi a van dyk biographyIlove this post I read your blog fairly often and you're always coming out with
some great stuff. I share this on my Facebook and my followers loved it.
Keep up the good work.
born-Live.Us ha detto:
29 aprile 2017 alle 21:22 · Rispondi a born-Live.UsA black T-shirt with Robust Bad's mug!!
Entrprise de publicite media et de Marketing internet ha detto:
30 maggio 2017 alle 7:28 · Rispondi a Entrprise de publicite media et de Marketing internetSatisfaction Garantie
Devis Gratuit
Création de site Internet de haut de gamme
S-N-C-CANADA est une agence web basée à Québec composée d’une équipe performante et
efficace de Designers, Programmeurs, Intégrateurs, Ergonomes et
Stratèges Web travaillant en collaboration sur plusieurs projwts de création dde sire
Internet à Québec et de marketing web pour plusieurs
entreprises dans différents secteurs. Notre objectif
est de créer des sites web performants qui donnme de la visibilité à votree entreprise
et apporte un réel retour sur investissement.
Nous nous spécialisons dans la création de sites web
fonctionnels, esthétiques et hauyt de gamme. Nous
afons les bons outils pour construire exactement cce dont vohs avez
besoin, en partant des sites simples informatifs jusqu’à la concfeption de boutiques électroniques ou de sites personnalisés.
Si vous cherchez à augmenter vos profits, vous
êtes au bon endroit. Nous couvrons tous les aspects du marketing Internet
qui peuvent vous amener des clients tout en gardqnt vos coûts
ausssi bas que possible
Nous sommes en mesure dde vous accompagner et de vous conseiller efficacement pour votre projet de développement de marketing en ligne, de créationde site Internet ou de refonte de votre site Web actuel, en établissant dès le départ une analyse stratégique
orientée vers vos objectifs d’affaires et conçue sur mesure en fonction de votre clientèle.
Notre service inclut:
- La conception de votre site web
- Compatibilité (Adapté) pour écran dde bureau, cellulaire et tablette
- Synchronisation avec Facebook, Twitter, Google Map
- Maintenace et mise à jour de votre site web (Backup)
- Site web sécurisé, et possibilité d'inclure, Audio, Video,
Document
Pdf, Paypal pour paiement sécurisé en ligne.
- Référencement Optimum SEO, Balisse méta,Site map,
référencement de vos images et requête envoyé à Google, Bing,
Yahoo pour vous ajouter à leur répertoire.
- L’assistance technique
Pour une conception de site Web, een faisant affaire avec S-N-C-CANADA, vous vois assurez d'avoir :
Un service raide et personnalisé.
Un site Web qui pejt évoluer dans le temps facilement, sans investissement majeur.
Un panneau de gestion pour vos mises à jour facile à utiliser et entièrement personnalisé à votre contenu.
Une programmation de qualité, facilitant le référencement de votre contenu par les moteurs de recherche.
(SEO)
Internet Fiber Illimité ha detto:
16 giugno 2017 alle 21:32 · Rispondi a Internet Fiber IllimitéAppreciation to my father who informed me on the topic of
this website, this web site is truly amazing.
hot boy cover ha detto:
17 luglio 2017 alle 10:43 · Rispondi a hot boy coverIt's hard to find well-informed people for this topic, however,
you seem like you know what you're talking about! Thanks
gifts ha detto:
18 dicembre 2017 alle 11:44 · Rispondi a giftsHi! Quick question that's completely off topic. Do you know how to make your site mobile friendly?
My blog looks weird when viewing from my iphone. I'm trying to find a template or plugin that might be able to correct this issue.
If you have any suggestions, please share.
Many thanks!
which the people use every day to work ha detto:
8 marzo 2018 alle 17:20 · Rispondi a which the people use every day to workThere is certainly a lot to find out about this issue. I love all the points you've made.
ssd vps ha detto:
15 marzo 2018 alle 13:30 · Rispondi a ssd vpsBuy Dedicated Server with free setup cost.
likes facebook ha detto:
2 luglio 2018 alle 0:10 · Rispondi a likes facebookI read this paragraph fully concerning the resemblance of hottest and earlier technologies,
it's awesome article.
جوال لينوفو ha detto:
16 agosto 2018 alle 11:05 · Rispondi a جوال لينوفوWow,this piece of writing is good, my more youthful is analyzing these things, so I amm going too tell her.
qooapp ha detto:
17 agosto 2018 alle 9:10 · Rispondi a qooapphttps://qooapp-apk.com/
get this latest vesrsion.
Amelia Stone ha detto:
26 agosto 2018 alle 2:55 · Rispondi a Amelia StoneGreetings!
Well done! I am looking for this kind of essay help educational webpage on the Internet. And your website is an awesome platform, where individuals can increase much knowledge and their learning! Keep doing awesome work. Thanks.
Situs Judi Casino SBOBET Rp 25rb ha detto:
18 settembre 2018 alle 5:23 · Rispondi a Situs Judi Casino SBOBET Rp 25rbIt's actually a nice and helpful piece of info. I'm happy that you just shared this helpful info with us.
Please keep us up to date like this. Thank you for sharing.
슬롯 ha detto:
22 aprile 2019 alle 22:24 · Rispondi a 슬롯I was recommended this web site through my cousin. I am now not
positive whether or not this post is written through him
as no one else recognize such targeted approximately my difficulty.
You are amazing! Thank you!
Xvideos Red ha detto:
26 luglio 2019 alle 18:31 · Rispondi a Xvideos RedWhаt's Ƭaking place i am new to this, I stumbleԁ upon this I have found
Ӏt absolutely useful and it has helped
me out loads. I am hoping to give a contribution & help different users lіke itѕ
aided me. Good ϳob.
games ha detto:
3 novembre 2019 alle 20:49 · Rispondi a gamesEvery weekend i used to pay a visit this web site, as i want enjoyment, since this this web site conations truly pleasant funny data too.
Https://Www.Instapaper.com/p/8005655 ha detto:
23 giugno 2020 alle 21:01https://Www.Instapaper.com/p/8005655
clorophilla.blog » About Predis and benchmarks: why a pure-PHP Redis client anyway?
lawrencwromero ha detto:
8 ottobre 2020 alle 9:44 · Rispondi a lawrencwromeroMovie lovers choosing avengers costumes for Halloween is the new trend. The casual and dapper look of the costumes will immediately will make you fall in love with characters al over again. Despite of what age you are, you will look classy in every costume.
fundraising consutants ha detto:
12 dicembre 2020 alle 4:21 · Rispondi a fundraising consutantsThank you for the blog post. Brown and I have been saving for just
a new ebook on this subject and your short article has made us
all to save money. Your opinions really resolved
all our queries. In fact, above what we had recognized
in advance of the time we ran into your great blog.
My partner and i no longer nurture doubts and a troubled mind because you have
actually attended to our needs in this post.
Thanks
Celebjacket ha detto:
1 marzo 2021 alle 12:37 · Rispondi a CelebjacketThank you for sharing Inspired by all the famous wrestlers, TV stars and actors from the famous movies worldwide, CelebJacket.com brings you the trendiest designs of jackets and coats this season. Grab your favorites now!