I have a very basic Ruby web application (currently in Hanami and in Rails) which provides VBS scripting functionalities to end users.
This is currently still on Windows.
The end user simply fills in a form and the web app triggers respecitve script and returns either requested data or just success/fail notification to the user.
The issue I have and can't resolve is, that all subsequent requests wait for the current one to finish.
I'm using Hanami or Rails with Puma or Thin. The result is always subsequent procesing. Even though this is still in dev, I have also tried production mode with Hanami.
For Rails I have tried removing Rack::Lock as well, but to no avail.
The VBS script itself is translated to Ruby via win32ole lib.
Funny thing is, if I run the same script from a simple .rb file like so:
threads = []
threads << Thread.new{
my_method(arg1, arg2)
}
threads << Thread.new{
my_method(arg1, arg2)
}
threads << Thread.new{
my_method(arg1, arg2)
}
threads.each {|t| t.join}
they run in parallel.
EDIT start: custom logs for pure ruby script
Connection [3] is opened at: 2019-02-25 10:11:10 +0100
Connection [4] is opened at: 2019-02-25 10:11:10 +0100
Connection [5] is opened at: 2019-02-25 10:11:13 +0100
User in connection [3] is logged in at: 2019-02-25 10:11:15 +0100
User in connection [4] is logged in at: 2019-02-25 10:11:16 +0100
User in connection [5] is logged in at: 2019-02-25 10:11:19 +0100
Params in connection [4] are set in system at: 2019-02-25 10:11:20 +0100
Params in connection [3] are set in system at: 2019-02-25 10:11:21 +0100
System in connection [4] is closed at: 2019-02-25 10:11:21 +0100
System in connection [3] is closed at: 2019-02-25 10:11:26 +0100
Params in connection [5] are set in system at: 2019-02-25 10:11:26 +0100
System in connection [5] is closed at: 2019-02-25 10:11:27 +0100
Connection [0] is opened at: 2019-02-25 10:11:03 +0100
Connection [1] is opened at: 2019-02-25 10:11:03 +0100
Connection [2] is opened at: 2019-02-25 10:11:05 +0100
User in connection [0] is logged in at: 2019-02-25 10:11:08 +0100
User in connection [2] is logged in at: 2019-02-25 10:11:10 +0100
User in connection [1] is logged in at: 2019-02-25 10:11:10 +0100
Params in connection [0] are set in system at: 2019-02-25 10:11:12 +0100
Params in connection [1] are set in system at: 2019-02-25 10:11:12 +0100
System in connection [0] is closed at: 2019-02-25 10:11:13 +0100
System in connection [1] is closed at: 2019-02-25 10:11:17 +0100
Params in connection [2] are set in system at: 2019-02-25 10:11:17 +0100
System in connection [2] is closed at: 2019-02-25 10:11:19 +0100
The logs above show seconds only, but still one can see actions are not completely sequential. Furthermore, I see the scripts opening windows in parallel and performing actions whereas with web app it's clear that the second script window doesn't open until the first one is closed.
EDIT end
EDIT 2 start -- nginx implementation
I've added nginx to the mix and the result is the same. Web app still executes scripts in requests sequentially.
EDIT 2 end
I'm stuck and don't know anymore where to go next for debugging.
Does anyone have any ideas? Thank you.
seba