dotnwat / lua-rados

RADOS bindings for Lua
http://noahdesu.github.com/lua-rados/
7 stars 7 forks source link

how much qps as lua-rados #24

Open Password2008 opened 7 years ago

Password2008 commented 7 years ago

Hi, did you have a test for lua-rados‘ qps ? I test it's qps just only 7-9

dotnwat commented 7 years ago

The Lua bindings shouldn't add much overhead, aside from concurrency: the Lua VM is not multi-threaded (AFAIK). What is your benchmark? What kind of performance do you get using RADOS without Lua?

Password2008 commented 7 years ago

But I has 30+ qps on python cephgw at same benchmark( ab、wrk、python scripts) . I thought lua-rados api is asynchronous transfer mode , will perform better than python cephgw.

Password2008 commented 7 years ago

Maybe I should use ngx.thread.spawn to exec lua-rados ?

dotnwat commented 7 years ago

Can you post a small lua script that you are using for the benchmark? I"ll try to reproduce.

On Tue, May 30, 2017 at 6:56 PM, Password2008 notifications@github.com wrote:

Maybe I should use ngx.thread.spawn to exec lua-rados ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/noahdesu/lua-rados/issues/24#issuecomment-305060079, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOy8f5yxEJoJAyNQJHOwJO8hVEvliCiks5r_MjKgaJpZM4NoRUN .

Password2008 commented 7 years ago

counter = 0 request = function() mypath = "/dev/shm/0f53ec0c60e7932ae88518aa4001823c.mp3"; --size : 3.5M local file = io.open(mypath, "r"); assert(file); local body = file:read("*a"); -- 读取所有内容 file:close(); wrk.method = "POST" wrk.body = body --path = "/" .. mypath .. "-" .. counter path = "/fileupload?descpath=test/mchen/0f53ec0c60e7932ae88518aa4001823c.mp3" .. counter wrk.headers["Content-Type"] = "multipart%/form-data" wrk.headers["X-Counter"] = counter counter = counter + 1 return wrk.format(nil, path) end done = function(summary, latency, requests) io.write("------------------------------\n") for _, p in pairs({ 50, 60, 90, 95, 99, 99.999 }) do n = latency:percentile(p) io.write(string.format("%g%%, %d ms\n", p, n/1000.0)) end end

--[[ $./wrk -c 50 -d 60 -t 5 -s put.lua http://oss-cn-hangzhou-test.aliyuncs.com 表示向Endpoint发起POST请求,请求的内容在put.lua中规定,有5个线程,开启的连接有50个,运行60秒 ]]--

dotnwat commented 7 years ago

maybe i'm missing something, but I don't see rados being called in this code snippet?

Password2008 commented 7 years ago

Now the best result is 5 connections and qps is 23, But if running 10 connections will have many requests timeout about lua-rados. I also test at ngx.thread.spawn but there is not much improvement.

dotnwat commented 7 years ago

do you have a small lua script that isn't performing as you expect? something like a small loop that just does a single rados operation? lua-rados shouldn't be imposing much overhead, so i'm curious, bu the script above isn't runnable.

Password2008 commented 7 years ago

This script can be run with wrk tool (https://github.com/wg/wrk) , sorry I don't have script that just run lua. don't you hava other benchmark tools as qps ? I don't think tools or scripts are important

Password2008 commented 7 years ago

building connections pool will be better ?