mardi 5 mai 2015

Freezing/locking errors when running Apache2/Passenger with Rails 3/omniauth-openid

I'm migrating a rails app from Unicorn/nginx to Apache2/Passenger (v5 open source version) and am having issues with application timeouts during the login process and I'm not sure even the problem lies - apache or passenger, or omni-auth.

We use omniauth-openid as a rails engine for authentication - when you enter an email address it sends off a request to the openid engine in the same app, which will then authenticate you and return that status to the original request which completes the login process.

Although i have multiple passenger processes running (8 max currently) the second request (to the openid engine) seems to always go back to the original blocking/blocked process.

The second request will then eventually time out and fail at exactly 60 seconds. The only message I get back from openid is:

(open_id) Authentication failure! connection_failed encountered.

passenger-status doesn't show second (or any subsequent) login attempts as being queued, it just creates a session on the one of the other concurrent processes but the openid requests ares still locked/frozen until the first one times out.

I'm not sure if apache is something limiting the connections through to passenger, or if passenger is somehow directing all the login requests to the one passenger process.

Any one have any idea as to where I could look next?

My passenger conf:

LoadModule passenger_module /home/jav/.rvm/gems/ruby-2.2.2@i3pro/gems/passenger-5.0.7/buildout/apache2/mod_passenger.so PassengerRoot /home/jav/.rvm/gems/ruby-2.2.2@i3pro/gems/passenger-5.0.7 PassengerRuby /home/jav/.rvm/gems/ruby-2.2.2@i3pro/wrappers/ruby PassengerDefaultRuby /home/jav/.rvm/gems/ruby-2.2.2@i3pro/wrappers/ruby PassengerUserSwitching on PassengerDefaultUser jav PassengerDefaultGroup jav PassengerMaxPoolSize 8

My passenger-status results after 3 concurrent login requests.

No processes to start with:

Version : 5.0.7
Date    : 2015-05-06 11:27:12 +1200
Instance: KR4Jkewi (Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.0.7)

 ----------- General information -----------
Max pool size : 8
Processes     : 0
Requests in top-level queue : 0

Three requests made - 3 processes started/processing a session, nothing in queue:

----------- Application groups -----------
Date    : 2015-05-06 11:50:07 +1200
----------- General information -----------
Max pool size : 8
Processes     : 4
Requests in top-level queue : 0
----------- Application groups -----------
/home/jav/code/voyager#default:
  App root: /home/jav/code/voyager
  Requests in queue: 0
  * PID: 19871   Sessions: 1       Processed: 0       Uptime: 22s
    CPU: 0%      Memory  : 145M    Last used: 22s ago
  * PID: 19879   Sessions: 1       Processed: 0       Uptime: 22s
    CPU: 0%      Memory  : 129M    Last used: 22s ago
  * PID: 19886   Sessions: 1       Processed: 0       Uptime: 22s
    CPU: 0%      Memory  : 121M    Last used: 22s ago
  * PID: 19894   Sessions: 0       Processed: 0       Uptime: 21s
    CPU: 0%      Memory  : 76M     Last used: 21s ago

After time out, The first process has processed 4 requests (with 3 timeouts), while the rest only have processed the one request after being locked:

Date    : 2015-05-06 11:51:03 +1200
----------- General information -----------
Max pool size : 8
Processes     : 4
Requests in top-level queue : 0
----------- Application groups -----------
/home/jav/code/voyager#default:
  App root: /home/jav/code/voyager
  Requests in queue: 0
  * PID: 19871   Sessions: 0       Processed: 4       Uptime: 1m 18s
    CPU: 0%      Memory  : 166M    Last used: 17s ago
  * PID: 19879   Sessions: 0       Processed: 1       Uptime: 1m 18s
    CPU: 0%      Memory  : 136M    Last used: 1m 18s ago
  * PID: 19886   Sessions: 0       Processed: 1       Uptime: 1m 18s
    CPU: 0%      Memory  : 129M    Last used: 1m 18s ago
  * PID: 19894   Sessions: 0       Processed: 0       Uptime: 1m 17s
    CPU: 0%      Memory  : 76M     Last used: 1m 17s ago

Aucun commentaire:

Enregistrer un commentaire