I have the nginx upload module handling site uploads, but still need to transfer files (3-20 MB each, let's say) to our CDN, and would rather not delegate that to a background job. what is the best way to do this with Tornado without blocking other requests? Can I do this in an async callback?
matt's questions
how and how well does perlbal handle uploads? does it take care of buffering the entire file to disk efficiently, and then pass arguments or headers to the backend describing the file? right now, im using nginx's upload module, but i'd like to use perlbal's X-REPROXY-URL capability to transparently serve files from a cdn.
why would perlbal's reproxying give me a 503 for any remote url?
X-REPROXY-URL: /path/to/a/local/file.jpg = working
X-REPROXY-URL: http://a-public-file-in-an-s3-bucket.jpg = HTTP 503
my perlbal conf looks like:
CREATE POOL test_pool
POOL test_pool ADD 127.0.0.1:8888
POOL test_pool ADD 127.0.0.1:8889
CREATE SERVICE balancer
SET listen = 0.0.0.0:80
SET role = reverse_proxy
SET pool = test_pool
SET persist_client = on
SET persist_backend = on
SET verify_backend = on
SET enable_reproxy = true
ENABLE balancer
i know im setting the header properly, because, as i said, it works for local files and urls of the same domain.
With Apache, if MaxClients
is set to 150
, does that mean Apache will try to serve up to 150 concurrent requests, and queue subsequent requests until all one of the 150 clients is available to serve? This assumes KeepAlive
is off.
Also, if ServerCount
is 2
, does this mean that Apache will create 2 instances that can each process 150 concurrent requests, or that 150 concurrent requests could be served across the 2 instances?
Thanks in advance!
in a production environment running nginx reversing back to apache mpm-prefork/mod_wsgi, im seeing 90 apache child processes, when i would expect that 40 would be the maximum, as configured below. the configuration/setup is nothing exciting:
- nginx is reverse proxying to apache via
proxy_pass
, and serving static media - apache only serves dynamic requests
relevant nginx config:
worker_processes 15;
events {
worker_connections 1024;
}
keepalive_timeout 10;
relevant apache config:
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
StartServers 20
MinSpareServers 7
MaxSpareServers 10
MaxClients 200
MaxRequestsPerChild 0
</IfModule>
mod_wsgi config, where webapp
is the name of the process:
WSGIDaemonProcess webapp user=www group=users threads=1 processes=40
am i missing something?