Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2001 13:11:48 +0300 (EEST)
From:      Giorgos Verigakis <verigak@algol.vtrip-ltd.com>
To:        <freebsd-hackers@freebsd.org>
Subject:   Zope's performance issues
Message-ID:  <Pine.LNX.4.30.0108211250450.24969-100000@algol.vtrip-ltd.com>

next in thread | raw e-mail | index | archive | help
Hello, I'm using Zope application server (www.zope.org) on FreeBSD
and I'm experiencing some serious performance issues.
Since I hadn't noticed any problems at the past with Linux, I did
some  benchmarks to investigate it a little.

I've written a small program that connects to Zope and tries to
retrieve a non-existant URL (source code appended). While Linux
performed almost linearly depending on the number of hits/sec,
FreeBSD (and OpenBSD) performed exponential. I allready sent
a mail to the zope-list but I did not get much info.
Since Zope is a threaded application I was wondering maybe it
was related with the thread implementation (the scheduling maybe?)

I did the following experiment:
I installed a binary distribution of python-1.5.2 (pkg_add or apt-get)
and I compiled Zope-2.3.3+HotFix from sources.
I started running the previous program and after about 1000 hits
(when the server would be a bit loaded) I reloaded a fairly complex
page and measured the time it gets to finish. The results are below:

+---------------------+------------+---------------+-------------+
|        OS           | Hit Rate*  | Real hit rate | Reload time |
|                     | (hits/sec) | (hits/sec)    | (sec)       |
+---------------------+------------+---------------+-------------+
|                     |     30     |      20       |      13     |
| Linux debian 2.2.19 |     50     |      33       |      16     |
|                     |    100     |      38       |      16     |
+---------------------+------------+---------------+-------------+
|                     |     30     |      20       |      10     |
| FreeBSD 4.3-Release |     50     |      33       |      23     |
|                     |    100     |      40       |     100     |
+---------------------+------------+---------------+-------------+
|                     |     30     |      20       |      10     |
| OpenBSD 2.9-Release |     50     |      33       |      15     |
|                     |    100     |      50       |     285     |
+---------------------+------------+---------------+-------------+
*The hit rate is the one passed as an argument to the program, while
real hit rate was calculated according to Zope's log file.
All tests were ran on the same computer, a 600MHz Celeron with
192MB RAM

These tests were ran using the default content. When I use a real
(more heavy) content I even get time-outs when I try to access
some pages.
Has anyone in this list had any previous experience with zope? and
how do tou explain the big differences between the OSs?

Thank you in advance
Giorgos Verigakis


------------------ 8< ------------------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

int main(int argc, char *argv[])
{
        struct sockaddr_in sa;
        struct hostent *hp;
        int s;
        int i, t, len;
        unsigned long sleeptime;
        char request[128];
        char *url="/foo";

        if (argc != 4) {
                printf("Usage: %s <host> <port> <rate>\n", argv[0]);
                printf("rate in hits/sec\n");
                exit(1);
        }

        if ((hp = gethostbyname(argv[1])) == NULL) {
                printf("error looking up host\n");
                exit(1);
        }

        sprintf(request, "GET %s HTTP/1.0\015\012\015\012", url);
        len = strlen(request);
        sleeptime = (1 / atof(argv[3])) * 1000000;

        bzero(&sa, sizeof(sa));
        bcopy(hp->h_addr, (char *)&sa.sin_addr, hp->h_length);
        sa.sin_family = hp->h_addrtype;
        sa.sin_port = htons(atoi(argv[2]));

        for (i = 0;; i++) {
                if (( s = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
                        printf("Socket error\n");
                        continue;
                }

                if (connect(s, (struct sockaddr *) &sa, sizeof sa) < 0) {
                        printf("Connection error\n");
                        close(s);
                        continue;
                }

                t = write(s, request, len);
                printf("i=%d: %d bytes\n", i, t);

                usleep(sleeptime);

                close(s);
        }
}
------------------ 8< ------------------



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.30.0108211250450.24969-100000>