Problem with HEAD http requests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with HEAD http requests

Menke, Mikolaj
Hello,

We are running Nexus 2.6.2 which is behind a proxy and it began to cause some problems recently. Developers report that from time to time their CI systems receive "proxy error 502". I have made an investigation and it turned out that the proxy times out before Nexus returns any answer for the request. The requests are for artifacts in groups and it seems that Nexus if cannot find them on its storage starts searching through all the repos in the group which lasts quite long. These groups contain a few dozens of repos, some of them are locally hosted, some are proxied. When a request comes to Nexus directly without the proxy then it returns "not found 404" after a few minutes. I thought that I might use one of the following solutions (provided the above conclusion is correct):
1. Tell developers to stop using groups and request repositories directly, this will allow Nexus to search for artifacts faster. Is my thinking correct? I prefer this solution.
2. Remove some repos from the group to speed up searching, but this may break some builds since some users will not be aware why some artifacts are missing.
3. Increase time out on the proxy, but this has another disadvantage that resources may finish.
Is there any other solution?

There is also another problem with HTTP HEAD requests - I have noticed that when such request comes Nexus responds, but does not close the connection immediately and for some unknown reason waits from several seconds to even minutes to close. This one also causes time outs. Any suggestions on this?

Thank you in advance for your help.

Regards,
Mikolaj Menke


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Problem with HEAD http requests

Grierson, David
If you're using Apache as the proxy server for Nexus you can use the "ProxyTimeout" directive to tell Apache to wait for a specified amount of time before it times out and returns that 502 error.

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxytimeout

For example - the following will wait for 5 minutes:

ProxyTimeout 600

David.
--
David Grierson - SDLC Tools Specialist
Sky Broadcasting - Customer Business Systems - SDLC Tools
Email: [hidden email]
Watermark Building, Alba Campus, Livingston, EH54 7HH
Information in this email including any attachments may be privileged, confidential and is intended exclusively for the addressee. The views expressed may not be official policy, but the personal views of the originator. If you have received it in error, please notify the sender by return e-mail and delete it from your system. You should not reproduce, distribute, store, retransmit, use or disclose its contents to anyone. Please note we reserve the right to monitor all e-mail communication through our internal and external networks. SKY and the SKY marks are trademarks of British Sky Broadcasting Group plc and Sky International AG and are used under licence. British Sky Broadcasting Limited (Registration No. 2906991), Sky-In-Home Service Limited (Registration No. 2067075) and Sky Subscribers Services Limited (Registration No. 2340150) are direct or indirect subsidiaries of British Sky Broadcasting Group plc (Registration No. 2247735). All of the companies mentioned in this paragraph are incorporated in England and Wales and share the same registered office at Grant Way, Isleworth, Middlesex TW7 5QD.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with HEAD http requests

Rich Seddon
In reply to this post by Menke, Mikolaj
Answers inline below...


On Thu, Jul 10, 2014 at 4:24 AM, Menke, Mikolaj <[hidden email]> wrote:
Hello,

We are running Nexus 2.6.2 which is behind a proxy and it began to cause some problems recently. Developers report that from time to time their CI systems receive "proxy error 502". I have made an investigation and it turned out that the proxy times out before Nexus returns any answer for the request. The requests are for artifacts in groups and it seems that Nexus if cannot find them on its storage starts searching through all the repos in the group which lasts quite long. These groups contain a few dozens of repos, some of them are locally hosted, some are proxied. When a request comes to Nexus directly without the proxy then it returns "not found 404" after a few minutes. I thought that I might use one of the following solutions (provided the above conclusion is correct):
1. Tell developers to stop using groups and request repositories directly, this will allow Nexus to search for artifacts faster. Is my thinking correct? I prefer this solution.

This is not the recommended approach.  By doing this you push repository management into your settings.xml files, this is going to result in slower builds, and also will be very difficult to maintain going forward as new repositories are added.

2. Remove some repos from the group to speed up searching, but this may break some builds since some users will not be aware why some artifacts are missing.
3. Increase time out on the proxy, but this has another disadvantage that resources may finish.
Is there any other solution?

Put the slow proxy repositories at the bottom of the group repository's ordered list of repositories.   This will ensure that most artifact requests do not go to these proxy's.

Consider adding some manual routing rules to further limit the requests going to these proxy repositories.   You might also want to just block access to the remotes entirely.  To do this right click on the proxy and select "block remote".  This will allow currently cached artifacts to be downloaded, but will prevent outbound requests to the proxy  repositories.


There is also another problem with HTTP HEAD requests - I have noticed that when such request comes Nexus responds, but does not close the connection immediately and for some unknown reason waits from several seconds to even minutes to close. This one also causes time outs. Any suggestions on this?


It sounds like you have a client that is not closing the connection properly.  Enabling access logging should help you find this.

Rich

 
Thank you in advance for your help.

Regards,
Mikolaj Menke


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

RE: Problem with HEAD http requests

Menke, Mikolaj
> From: Rich Seddon [mailto:[hidden email]]
>
> Answers inline below...
>
> …
>
> Consider adding some manual routing rules to further limit the requests going to these proxy repositories.   You might also want to just block access to the remotes entirely.  To do this right click on the proxy and select "block remote".  This will allow currently cached artifacts to be downloaded, but will prevent outbound requests to the proxy  repositories.

Hello,
I have played with manual routing rules a little and it seems it helped. Thank you very much.
Regards,
Mikolaj Menke