2

As the Google App Engine development server only serves one file at a time, I decided to have static resources served instead by: Apache 2.2.17 / XAMPP 1.7.4 / WinXP32. Requests for dynamically created resources are routed to the GAE development server, using Apache's "ProxyPass". Works reliably and fast in general.

However, when accessed via Apache, a dynamically created resource sometimes takes a very long time to load. At first I thought that this is due to the GAE development server responding slowly. But when loading the same resource directly from the GAE development server, then the response is always fast.

What may be the reason for these slow responses?

Excerpt from the Apache log (note the wait from 10:10:42 to 10:10:53):

[Fri Aug 05 10:10:42 2011] [debug] proxy_util.c(2444): proxy: HTTP: fam 2 socket created to connect to localhost
[Fri Aug 05 10:10:42 2011] [debug] proxy_util.c(2576): proxy: HTTP: connection complete to 127.0.0.1:8080 (localhost)
[Fri Aug 05 10:10:53 2011] [debug] mod_proxy_http.c(1735): proxy: start body send
[Fri Aug 05 10:10:53 2011] [debug] mod_proxy_http.c(1839): proxy: end body send

Apache configuration, shortened:

NameVirtualHost 127.0.0.1:8081
Listen 127.0.0.1:8081
<VirtualHost 127.0.0.1:8081>
    ProxyPass /demo/images !
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

    Alias /demo/images "C:/Scratch/realitybuilder/demo/images"
    <Directory "C:/Scratch/realitybuilder">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        AddDefaultCharset utf-8
    </Directory>
</VirtualHost>
Shog9
  • 420
  • 1
  • 10
  • 24
feklee
  • 505
  • 5
  • 19

1 Answers1

2

I had a similar problem using Apache as a reverse proxy for GAE development. I ended up solving it by switching to nginx. It's faster, and also easier to configure. You can see an example config here.

dmnd
  • 136
  • 3
  • Just put that in the TODO list for the project in question, thanks! (unfortunately I cannot vote up your answer due to my lack of reputation) – feklee Dec 08 '11 at 10:23
  • No problem, once you verify nginx works you could come back and mark this answer as accepted. – dmnd Dec 08 '11 at 22:54
  • Finally got back to GAE development, and verified that nginx indeed does the trick (on WinXP)! – feklee Feb 26 '12 at 12:47