Deployment with Apache, Haproxy, Paster and ZEO

71 views
Skip to first unread message

Sascha Boch

unread,
May 3, 2012, 6:45:14 AM5/3/12
to pylons-devel
Hi there!

I have an issue with my application that is running very slow when
using ZEO. Actually, it's 3x slower than when I just use Paster and
omit ZEO. I noticed that the CPU load is distributed to all CPU cores
when using the ZEO setup whereas paster only uses one CPU core.

Ok, here are the configuration files:

zeo.conf:

%define INSTANCE /srv/myapptest

<zeo>
address $INSTANCE/zeo.sock
read-only false
invalidation-queue-size 100
pid-filename $INSTANCE/zeo.pid
</zeo>

<blobstorage 1>
<filestorage>
path $INSTANCE/myapp/Data.fs
</filestorage>
blob-dir $INSTANCE/blobs
</blobstorage>


haproxy.conf:

global
maxconn 256

defaults
mode http
timeout connect 5s
timeout client 5m
timeout server 5m
monitor-uri /haproxy-ping
stats enable
stats uri /haproxy-status
stats refresh 60s
stats realm Haproxy\ statistics

listen http-in
bind 127.0.0.1:8100
balance leastconn
server server1 127.0.0.1:8101 maxconn 32
server server2 127.0.0.1:8102 maxconn 32
server server3 127.0.0.1:8103 maxconn 32
server server4 127.0.0.1:8104 maxconn 32


production_zeo.ini: (used for ZEO setup with 4 clients)

[app:main]
use = egg:myapp
pyramid.reload_templates = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = false
pyramid.default_locale_name = en
pyramid.includes = pyramid_tm
pyramid_zodbconn
zodbconn.uri = zeo://%(here)s/../zeo.sock?connection_pool_size=1&cache_size=50MB
tm.attempts = 3

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = %(http_port)s


production.ini: (used with paster setup only)

[app:main]
use = egg:myapp
pyramid.reload_templates = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = false
pyramid.default_locale_name = en
pyramid.includes = pyramid_tm
pyramid_zodbconn
zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=200000
tm.attempts = 3

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 8100

I'd like to know how I can configure the setup to:
- run single-threaded ZEO clients,
- define connection cache size and
- define client cache size

Thank you very much for your help in advance!
Sascha

Sascha Boch

unread,
May 3, 2012, 10:40:56 AM5/3/12
to pylons...@googlegroups.com

- run single-threaded ZEO clients,

Ok, I got that. threadpool_workers must be set in the ini file.
Reply all
Reply to author
Forward
0 new messages