Hello ng, --- After a few hours, Zope becomes irresponsive and lashes out these kind of errors. Traceback (most recent call last): File "/usr/local/lib/zope/lib/python/ZPublisher/Publish.py", line 104, in publish response.setBody(result) File "/usr/local/lib/zope/lib/python/ZServer/HTTPResponse.py", line 256, in setBody HTTPResponse.setBody(self, body, title, is_error, **kw) File "/usr/local/lib/zope/lib/python/ZPublisher/HTTPResponse.py", line 351, in setBody zlib.DEF_MEM_LEVEL,0) MemoryError: Can't allocate memory for compression object Traceback (most recent call last): File "/usr/local/lib/zope/lib/python/ZPublisher/Publish.py", line 101, in publish request, bind=1) File "/usr/local/lib/zope/lib/python/ZPublisher/mapply.py", line 88, in mapply if debug is not None: return debug(object,args,context) File "/usr/local/lib/zope/lib/python/ZPublisher/Publish.py", line 39, in call_object result=apply(object,args) # Type s<cr> to step into published object. File "/usr/local/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 306, in __call__ return self._bindAndExec(args, kw, None) File "/usr/local/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 343, in _bindAndExec return self._exec(bound_data, args, kw) File "/usr/local/lib/zope/lib/python/App/special_dtml.py", line 175, in _exec try: result = render_blocks(self._v_blocks, ns) File "/usr/local/lib/python2.3/string.py", line 135, in join return sep.join(words) MemoryError What is going wrong here? I'm running an OpenBSD-system with the latest Python 2.3.5 and 512 MB of RAM. The stack size is 0x100000, as opposed to 0x20000 that previous *BSD-distributions of Python had as default. Any clues are appreciated, \mb
File "/usr/local/lib/zope/lib/python/ZPublisher/HTTPResponse.py", line 351, in setBody zlib.DEF_MEM_LEVEL,0) MemoryError: Can't allocate memory for compression object
<thinking loud> zlib? Did your zope work fine before? Remember, about 2 weeks ago they found a vunorability in zlib, didn't they. Maybe there are some implications into that on openbsd. </thinking loud>
What is going wrong here? I'm running an OpenBSD-system with the latest Python 2.3.5 and 512 MB of RAM. The stack size is 0x100000, as opposed to 0x20000 that previous *BSD-distributions of Python had as default.
Any clues are appreciated,
\mb
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
Peter Bengtsson <peterbe@gmail.com> wrote in news:bc95c28005072102303c8209c5@mail.gmail.com:
<thinking loud> zlib? Did your zope work fine before? Remember, about 2 weeks ago they found a vunorability in zlib, didn't they. Maybe there are some implications into that on openbsd. </thinking loud>
Well, --- it doesn't sound likely, because it's not only with zlib. I just got this one: 2005-07-21T12:34:18 ERROR(200) SiteError http://nanotek.nano.ku.dk/computere/problemer/terror Traceback (most recent call last): File "/usr/local/lib/zope/lib/python/ZPublisher/Publish.py", line 92, in publish File "/usr/local/lib/zope/lib/python/ZPublisher/BaseRequest.py", line 350, in traverse got=1 File "/usr/local/lib/zope/lib/python/ZODB/Connection.py", line 600, in setstate # end of a transaction and if the object was invalidated File "/usr/local/lib/zope/lib/python/ZODB/Connection.py", line 639, in _set_ghost_state File "/usr/local/lib/zope/lib/python/ZODB/Connection.py", line 227, in _persistent_load self._cache.incrgc() MemoryError I restart Zope and all is well. I'm running Zope 2.7.6-final by the way. Perhaps I should upgrade to 2.7.7. Hopefully this is solved with 2.8.0, but it looks like the next compatible Plone release is some way ahead still. \mb
How about ditching OpenBSD and installing a streamline linux like debian instead? There seems to be a problem with your python, not Zope. Zope just happens to manage to stresstest your python binaries. (I'm not saying linux is better than bsd, but it appears that python works better on linux for serious applications) On 7/21/05, Malthe Borch <mborch@dsri.dk> wrote:
Peter Bengtsson <peterbe@gmail.com> wrote in news:bc95c28005072102303c8209c5@mail.gmail.com:
<thinking loud> zlib? Did your zope work fine before? Remember, about 2 weeks ago they found a vunorability in zlib, didn't they. Maybe there are some implications into that on openbsd. </thinking loud>
Well, --- it doesn't sound likely, because it's not only with zlib. I just got this one:
2005-07-21T12:34:18 ERROR(200) SiteError http://nanotek.nano.ku.dk/computere/problemer/terror Traceback (most recent call last): File "/usr/local/lib/zope/lib/python/ZPublisher/Publish.py", line 92, in publish
File "/usr/local/lib/zope/lib/python/ZPublisher/BaseRequest.py", line 350, in traverse got=1 File "/usr/local/lib/zope/lib/python/ZODB/Connection.py", line 600, in setstate # end of a transaction and if the object was invalidated File "/usr/local/lib/zope/lib/python/ZODB/Connection.py", line 639, in _set_ghost_state
File "/usr/local/lib/zope/lib/python/ZODB/Connection.py", line 227, in _persistent_load self._cache.incrgc() MemoryError
I restart Zope and all is well. I'm running Zope 2.7.6-final by the way. Perhaps I should upgrade to 2.7.7. Hopefully this is solved with 2.8.0, but it looks like the next compatible Plone release is some way ahead still.
\mb
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
Peter Bengtsson <peterbe@gmail.com> wrote in news:bc95c28005072103136349dfc4@mail.gmail.com:
How about ditching OpenBSD and installing a streamline linux like debian instead? There seems to be a problem with your python, not Zope. Zope just happens to manage to stresstest your python binaries. (I'm not saying linux is better than bsd, but it appears that python works better on linux for serious applications)
Theo might be listening --- I'd rather not. OpenBSD is a great platform, and if there's music to be faced, OpenBSD will surely face it. But if these errors persist, I might have too. \mb
Malthe Borch wrote:
Theo might be listening --- I'd rather not. OpenBSD is a great platform, and if there's music to be faced, OpenBSD will surely face it. But if these errors persist, I might have too.
I've found OpenBSD/AMD64 and Zope to be an excellent platform. As I say I just need to track down this bug in python that has just become apparent (we have been running for almost a year without hitting it, so not too serious). The Opteron 244 (1.8Ghz) is about 20% or so faster on pystone than a 3Ghz Xeon, not very scientific test or relevent to real life, but a good guide). Especially interesting considering you can buy 2.8Ghz Opterons right now. -Matt -- Matt Hamilton matth@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Design | Zope/Plone Development & Consulting | Co-location | Hosting
Matt Hamilton <matth@netsight.co.uk> wrote in news:42DF89EC.8050109@netsight.co.uk:
The Opteron 244 (1.8Ghz) is about 20% or so faster on pystone than a 3Ghz Xeon, not very scientific test or relevent to real life, but a good guide). Especially interesting considering you can buy 2.8Ghz Opterons right now.
I'm not too impressed with our system's performance, but I haven't profiled our site yet or set up a proper proxy. The system is always very responsive in the shell, so I think that Zope might use the disks too excessively. \mb
Malthe Borch wrote:
MemoryError
What is going wrong here? I'm running an OpenBSD-system with the latest Python 2.3.5 and 512 MB of RAM. The stack size is 0x100000, as opposed to 0x20000 that previous *BSD-distributions of Python had as default.
Malthe, What architecture are you running OpenBSD on? We have been running Zope on OpenBSD/AMD64 3.6 for about a year now and it works pretty well. I have however recently discovered a python bug that I am trying to track down. I am unsure of the exact problem, but it affects the re and string libs: zeo1# uname -a OpenBSD zeo1.netsight.co.uk 3.6 conf#0 amd64 zeo1# python Python 2.3.4 (#1, Nov 16 2004, 08:26:06) [GCC 3.3.2 (propolice)] on openbsd3 Type "help", "copyright", "credits" or "license" for more information.
import string string.whitespace '\t\n\x0b\x0c\r \x89\x8a\x8b\x8c\x8d\xa0'
on all other platforms I've tried string.whitespace stops after '\r'... the trailing chars cause problems in weird and wonderful places. I upgraded to python 2.3.5 and get the same result. Not tried on python 2.4 yet. Other than that, we've not had any memory issues. On OpenBSD a single process cannot grow over 1GB of process memory (it can get more than that via anon-mmap, but python doesn't support that). On OpenBSD 3.5 we notice that if we hit the 1GB barrier hard it would panic the kernel, but that was fixed in 3.6. How much memory is python using when you get the memory errors? Has it truely used up all the memory on the system? There are soft limits that are set via login.conf and ulimit/limits which may be too low for you. -Matt -- Matt Hamilton matth@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Design | Zope/Plone Development & Consulting | Co-location | Hosting
Matt Hamilton <matth@netsight.co.uk> wrote in news:42DF79CE.5020708@netsight.co.uk:
What architecture are you running OpenBSD on? We have been running Zope on OpenBSD/AMD64 3.6 for about a year now and it works pretty well.
We're running a dual-cpu system: cpu0: Intel(R) Xeon(TM) CPU 2.80GHz ("GenuineIntel" 686-class) 2.80 GHz cpu1: Intel(R) Xeon(TM) CPU 2.80GHz ("GenuineIntel" 686-class) 2.80 GHz
How much memory is python using when you get the memory errors? Has it truely used up all the memory on the system? There are soft limits that are set via login.conf and ulimit/limits which may be too low for you.
According to 'top', the total load is: * Memory: 80M/131M act/tot Free: 366M Swap: 0K/1028M used/tot, where Zope itself is using practically all of it. \mb
According to 'top', the total load is:
* Memory: 80M/131M act/tot Free: 366M Swap: 0K/1028M used/tot,
where Zope itself is using practically all of it.
Well the question is, should Zope be using all that memory? how big is the site, what are you doing, how big are your caches etc? Our zope processes normally run about 500 - 750MB so maybe you just don't have enough memory. But odd that no swap is being used in your case. I would check your per-process memory limits maybe they need to be higher. Our 'zope' account is in login class 'daemon' which has higher default memory limits than 'standard'. And even then we bumped the limits up even higher. -Matt -- Matt Hamilton matth@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Design | Zope/Plone Development & Consulting | Co-location | Hosting
Matt Hamilton <matth@netsight.co.uk> wrote in news:42DF88ED.4070206@netsight.co.uk:
Well the question is, should Zope be using all that memory? how big is the site, what are you doing, how big are your caches etc? Our zope processes normally run about 500 - 750MB so maybe you just don't have enough memory.
Our site isn't especially large or complex (http://nanotek.nano.ku.dk). We do use the re-library and PIL rather extensively, but nothing the machine can't handle.
But odd that no swap is being used in your case. I would check your per-process memory limits maybe they need to be higher. Our 'zope' account is in login class 'daemon' which has higher default memory limits than 'standard'. And even then we bumped the limits up even higher.
I'd like to try and set up Zope in another login-class. It seems correct, as there are soft limits on memory usage in the default class. How would I go about this? Do you use a custom zopectl or run it straight off inetd? I'm not too experienced in OpenBSD-specifics yet, so any advise is appreciated. \mb
I'd like to try and set up Zope in another login-class. It seems correct, as there are soft limits on memory usage in the default class. How would I go about this? Do you use a custom zopectl or run it straight off inetd? I'm not too experienced in OpenBSD-specifics yet, so any advise is appreciated.
You need to have a zope user (adduser) and put that in the deamon class when it asks you. If you already has the user then you can change the class with 'chpass zopeuser'. Then you need to edit /etc/login.conf to raise the limits of deamon if you need to, and run cap_mkdb if you use databse versions of the login.conf file. Zopectl doesn't need to change. Just remember to set the effective-user to zopeuser in zope.conf -Matt -- Matt Hamilton matth@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Design | Zope/Plone Development & Consulting | Co-location | Hosting
Matt Hamilton <matth@netsight.co.uk> wrote in news:42DF9070.3070605@netsight.co.uk:
You need to have a zope user (adduser) and put that in the deamon class when it asks you. If you already has the user then you can change the class with 'chpass zopeuser'. Then you need to edit /etc/login.conf to raise the limits of deamon if you need to, and run cap_mkdb if you use databse versions of the login.conf file.
Well, that wasn't very helpful afterall. It already was in login-class 'daemon'. However, I did try and boost the stack size for that class from 8MB to 32MB. We'll see how that works out. \mb
Matt Hamilton <matth@netsight.co.uk> wrote in news:42DF88ED.4070206@netsight.co.uk:
Well the question is, should Zope be using all that memory? how big is the site, what are you doing, how big are your caches etc? Our zope processes normally run about 500 - 750MB so maybe you just don't have enough memory.
But odd that no swap is being used in your case. I would check your per-process memory limits maybe they need to be higher. Our 'zope' account is in login class 'daemon' which has higher default memory limits than 'standard'. And even then we bumped the limits up even higher.
I bumped up the stacksize to 32MB, i.e. in /etc/login.conf: daemon:\ :ignorenologin:\ :datasize=infinity:\ :maxproc=infinity:\ :openfiles-cur=128:\ :stacksize-cur=32M:\ :localcipher=blowfish,8:\ :tc=default: This seems to have done the trick. At least I haven't experienced any errors during the last couple of hours, and everything seems quite healthy. I'll follow up if it turns out to be a fluke. \mb
Malthe Borch <mborch@dsri.dk> wrote in news:Xns969AC782E58BEmborchdsridk@80.91.229.5:
I'll follow up if it turns out to be a fluke.
It was. no candy. It did buy some time though, so there might be a real leak somewhere. \mb
[Matt Hamilton]
... We have been running Zope on OpenBSD/AMD64 3.6 for about a year now and it works pretty well. I have however recently discovered a python bug that I am trying to track down. I am unsure of the exact problem, but it affects the re and string libs:
zeo1# uname -a OpenBSD zeo1.netsight.co.uk 3.6 conf#0 amd64 zeo1# python Python 2.3.4 (#1, Nov 16 2004, 08:26:06) [GCC 3.3.2 (propolice)] on openbsd3 Type "help", "copyright", "credits" or "license" for more information.
import string string.whitespace '\t\n\x0b\x0c\r \x89\x8a\x8b\x8c\x8d\xa0'
on all other platforms I've tried string.whitespace stops after '\r'... the trailing chars cause problems in weird and wonderful places. I upgraded to python 2.3.5 and get the same result. Not tried on python 2.4 yet.
Python version won't matter: the value of string.whitespace is entirely determined by your platform C and the locale in effect when the C-coded portion of Python's string module (Modules/stropmodule.c) is imported. As you can see from that module's initstrop() function, string.whitespace consists exactly of the 8-bit characters (0-255) for which the platform C's isspace() macro returns a true value. The results you've seen on most systems: '\t\n\x0b\x0c\r ' is what it must be in the "C" locale (the C standard defines this), but if you're not in the "C" locale it could be anything. It's not unusual (well, not for non-Americans <wink>) to see \xa0 in that list, because \xa0 is Latin-1's non-breaking space character (" " in HTML). It's surprising to me to see \x89-\x8d there, though. It could be your system is set to use "an unusual" locale, or it could be a bug in the platform C libraries. Try writing a little C program to see what isspace() returns.
Tim Peters wrote:
(" " in HTML). It's surprising to me to see \x89-\x8d there, though. It could be your system is set to use "an unusual" locale, or it could be a bug in the platform C libraries. Try writing a little C program to see what isspace() returns.
Bingo! Thanks for the hints. You were correct, it was down to a mis-interpretation of the C99 and ISO 8859 standards. Looks like OpenBSD interprets it differently to everything else ;) The policy was changed 8 days ago: http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/ctype_.c "Correct ctype classifications of chars >= 0x80 wrt C99/POSIX and our man page. ok espie@ deraadt@" -Matt -- Matt Hamilton matth@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Design | Zope/Plone Development & Consulting | Co-location | Hosting
participants (4)
-
Malthe Borch -
Matt Hamilton -
Peter Bengtsson -
Tim Peters