How to test logins per second using omniauth / oauth? (Ruby + RSpec)

I want to check how many logins in seconds are possible with the help of the (own) omniauth provider. I need to find out how these omniauth / oauth requests work, and if this authentication is scalable anyway?

what i got so far:

def performance_auth(user_count=10) bm = Benchmark.realtime do user_count.times do |n| fork do click_on 'Logout' omniauth_config_mock(:provider => "foo", :uid => n, :email => "foo#{n}@example.net") visit "/account/auth/foo/" end end Process.waitall end puts "#{user_count} users Benchmark: #{bm}" bm end 

the default is 10 users who authenticate the parallel through the oauth foo provider.

results:

 only 2 users can authenticate parallel in 1 sec (is this possible?) 10 users: 5.090777 sec 20 users: 10.471208 sec 50 users: 111.565979 sec ~ 2min!!!! 

I really don’t know what I am doing, and if this code is right.

+6
source share
1 answer

While I don't have much experience with OAuth / Omniauth, the ~ 500ms rendering time for this kind of action, combined with the general Rails rendering time (I guess), seems like this is not so bad. IMO, trust your criteria.

0
source

Source: https://habr.com/ru/post/916211/


All Articles