Login VERY Slow

Solved!
Posted in General by Chris Campbell Tue Feb 23 2016 03:48:36 GMT+0000 (UTC)·6·Viewed 189 times

Hi, We're currently working toward a deployment solution of SKF that can be used by all of our developers. At present I've installed it on Xubunu 14.04 x64. The test Virtualbox VM (host is Windows 7 Professional) has 2GB memory and 2 vCPU. The install method is based on the contents of the AWS Cloudfront script, using the Apache WSGI module. The entire install is documented so I can provide this if desired. Once logged in the performance is nice and responsive. However, the login process takes approximately 1-2 minutes. I've disabled IPv6 on the box, and resource does not appear to be an issue - there's only a very minor spike in CPU + memory. Increasing to 4 vCPU didn't improve timing at all. Are you please able to advise of anything that could be done to improve the login time? Thanks, Chris
Foobar
Feb 23, 2016

Hi Chris,

Hmm i think that there might be a time-out related issue here that i seen before.
Is the server allowed to request external sources? Because we have a version check in the SKF project and will be triggered after login. If the server is not able to access this URL then it results in long waiting time as you described. The version check will notify you when there is a new release of the SKF project.

Can you let me know if this was the issue? Otherwise i will think with you what we might can do otherwise.

Greetz,
Glenn

Chris Campbell
Feb 23, 2016

Thanks for the quick response Glenn.

The server NAT's behind it's host and connects out through a squid proxy (defined through environment variables). Internet access isn't an issue in this case, but this will be factored into the final deployment where outbound access will be limited.

In a Python shell I look to be able to make the version check request:

import requests
requests.get("http://raw.githubusercontent.com/blabla1337/skf-flask/master/setup.py")

<Response [200]>

So don't think this is the issue.

Foobar
Feb 24, 2016

Hi Chris,

Aah oke so that's not the issue. Well it has to be in one of the login functions that is slowing the login down. I can only think of the following thing at the moment:

We use the in skf.py rand.bytes(128) to create a token, maybe thats not working properly in your environment and takes so long. Maybe set is to a static value in the login function to see if this is the problem.

If not working i will try to create a modified skf.py file so we can debug your problem.

Greetz,
Glenn

Chris Campbell
Feb 26, 2016

I managed to invoke that method with an almost instant response, so assuming it's not the cause of the problem either :-(

To save you the hassle I might enter some debug lines myself and try step through where exactly the delay is occurring. I'll update you with what I discover.

Chris Campbell
Feb 28, 2016

I've managed to work this out, and you were correct that the request to check the version was timing out.

To address this I imported urllib and specified the proxies in the request as follows:

r = requests.get("http://raw.githubusercontent.com/blabla1337/skf-flask/master/setup.py", proxies=urllib.getproxies())

... and the login is now instant.

Thanks for your direction.

Foobar
Mar 9, 2016

Hi Chris,

No problem, nice that you could verify it. If you have any other questions i'm happy to help.

Greetz,
Glenn


Foobar marked this as solved
Markdown is allowed