gemirro
gemirro copied to clipboard
Gemirro slows to a crawl after a few requests
I'm trying to use gemirro as a rubygems.org mirror for ~60 chef nodes that are behind a slow/unreliable HTTP proxy. But, I'm having a lot of problems getting gemirro to be reliable. I can start up a gemirro instance easily enough, but as soon as a request comes in, gemirro kicks up to 100% CPU usage and starts eating RAM. It will (very slowly) serve a few requests, but after a few minutes it gets overwhelmed and the nodes time out before gemirro gets to serving their requests. RAM use seems to stabilize around 3-4GB.
When I tried gemirro against a single node, I found that it does successfully serve the gem I asked for (called out in config.rb, so it's already downloaded), but it takes 20-30 seconds client side and also causes ~60 seconds of high CPU usage on the gemirro server before dropping back down. When I make a few requests at the same time from different machines, gem install
times out. This seems to happen no matter how I set update_on_fetch and fetch_gem in config.rb.
It seems like this behavior shouldn't be happening since it makes it impossible to use gemirro, but I can't tell the reason why. Something in my environment?
Here are the details of my gemirro setup as well as a sample log.
- System uses RHSCL ruby 2.4 on RHEL 6 (https://www.softwarecollections.org/en/scls/rhscl/rh-ruby24/)
- An apache reverse proxy is used for gemirro
- Gemirro connects to the internet thru a slow HTTP proxy
- I've noticed it can take 10-20 seconds to return http://rubygems.org/specs.4.8.gz, but other files are normal speed
- Proxy also limits the number of simultaneous HTTP connections
- config.rb and sample access.log are attached (some details removed) access.log config.rb.txt
Ruby info:
$ ruby --version
ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux-gnu]
$ gem --version
2.6.14
Apache reverse proxy for gemirro:
<VirtualHost *:8080>
ProxyPass /gemrepo http://127.0.0.1:2000
ProxyPassReverse /gemrepo http://127.0.0.1:2000
ProxyPreserveHost On
ProxyRequests Off
ServerName <redacted>
</VirtualHost>
Not sure it's your environment system. But I'm currently too busy with my work to have a check right now :(
OK, thanks for the reply. For now we'll go back to our old mirroring scheme. If I get back to testing gemirro and find out something else I'll post it here.