Home >Backend Development >PHP Tutorial >nginx+lua+redis
After the last test, I felt that this code still has room for improvement, so I checked how to use redis connection pool in golang (actually the use of redigo), and How to use redis connection pool in Lua (actually the use of rest.redis).
First the results:
Then look at golang:
lua code:
golang code:
In addition to adding a thread pool, golang also sets the number of cpu cores.
However, this test is not very rigorous. Redis, nginx, golang http server, and ab stress test are all on the same machine, and they will affect each other. If you are interested, you can deploy and test it separately.
The above has introduced nginx+lua+redis, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.