Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is faster, redis LPUSH or RPUSH?

Tags:

redis

I'm flexible for my application architecture in that I can use a queue or a stack. Is there a performance benefit to using either LPUSH or RPUSH?

like image 412
Jeff Puckett Avatar asked Jul 27 '17 17:07

Jeff Puckett


Video Answer


1 Answers

There is one more if in the RPUSH flow, but it is neglectable. Both are the same.

Run a few times redis-benchmark <params> lpush myllist __rand_int__ and a few times redis-benchmark <params> rpush myrlist __rand_int__ and compare the requests per second you get in each run.

like image 190
Ofir Luzon Avatar answered Oct 03 '22 23:10

Ofir Luzon