URGENT : site inaccessible when traffic is high
Hi, I have 2 nested loops, where the outer one iterated over folders and the inner one iterated over the dtml documents in each folder. I noticed that when the traffic is high, the site become inaccessible. could the problem caused by the loops? <dtml-in "news.objectValues(['Folder'])"> <dtml-let number=sequence-number path=id> <dtml-if expr="number < _.int(num)"> <dtml-in "objectValues(['DTML Document'])"> <dtml-try> <dtml-call "REQUEST.set('mm', ZopeTime().toZone('GMT+1').strftime('%d%m%y'))"> <dtml-let test=sequence-item> <dtml-if expr="mm==test"> <font face=arial size=-5> <dtml-var expr="_.getitem(mm,1)[0:400]">....<br> <a href="&dtml-ngrHome;news/&dtml-path;"> <img src="images/morex.gif" border="0" width="60" height="23"> </a><br> <dtml-if expr="number < _.int(num)-1"> <hr size="2" width="75%"> </dtml-if> </font> </dtml-if> </dtml-let> <dtml-except> </dtml-try> </dtml-in> </dtml-if> </dtml-let> </dtml-in> ===== Hamzat kamaldeen Ishola Dnet Systems Limited. 223 Ikorodu Road, Lagos. Nigeria. 234 1 7749381, 234 08033011305 --- Making Mistake is not a problem but readiness to admit it.. Sentimental decisions are not mistakes but failures !!! Mistake is an opportunity to see better !!! __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
that is a good example for trying to use DTML where it should not be used anymore. i suggest you move this logic into a more appropriate kind of object, such as a python script. jens On Monday, May 27, 2002, at 09:25 , Hamzat Kamal wrote:
Hi,
I have 2 nested loops, where the outer one iterated over folders and the inner one iterated over the dtml documents in each folder.
I noticed that when the traffic is high, the site become inaccessible.
could the problem caused by the loops?
<dtml-in "news.objectValues(['Folder'])"> <dtml-let number=sequence-number path=id> <dtml-if expr="number < _.int(num)"> <dtml-in "objectValues(['DTML Document'])"> <dtml-try> <dtml-call "REQUEST.set('mm', ZopeTime().toZone('GMT+1').strftime('%d%m%y'))"> <dtml-let test=sequence-item> <dtml-if expr="mm==test"> <font face=arial size=-5> <dtml-var expr="_.getitem(mm,1)[0:400]">....<br> <a href="&dtml-ngrHome;news/&dtml-path;"> <img src="images/morex.gif" border="0" width="60" height="23"> </a><br> <dtml-if expr="number < _.int(num)-1"> <hr size="2" width="75%"> </dtml-if> </font> </dtml-if> </dtml-let> <dtml-except> </dtml-try> </dtml-in> </dtml-if> </dtml-let> </dtml-in>
===== Hamzat kamaldeen Ishola
that is a good example for trying to use DTML where it should not be used anymore.
i suggest you move this logic into a more appropriate kind of object, such as a python script.
jens
<dtml-in "news.objectValues(['Folder'])"> <dtml-let number=sequence-number path=id> <dtml-if expr="number < _.int(num)"> <dtml-in "objectValues(['DTML Document'])"> <dtml-try> <dtml-call "REQUEST.set('mm', ZopeTime().toZone('GMT+1').strftime('%d%m%y'))"> <dtml-let test=sequence-item> <dtml-if expr="mm==test"> <font face=arial size=-5> <dtml-var expr="_.getitem(mm,1)[0:400]">....<br> <a href="&dtml-ngrHome;news/&dtml-path;"> <img src="images/morex.gif" border="0" width="60" height="23"> </a><br> <dtml-if expr="number < _.int(num)-1"> <hr size="2" width="75%"> </dtml-if> </font> </dtml-if> </dtml-let> <dtml-except> </dtml-try> </dtml-in> </dtml-if> </dtml-let> </dtml-in> Thanks Jens for the quick response. The main point here is that i am new to python but desperate to know it. I will be greatful if you could assist to convert the dtml code to python script then this will be a starting point for me too. Regards
Hamzat, It'd be useful to be able to understand what this DTML is trying to do... it seems like you're just looping over objects trying to find one with a particular id. Is "num" passed in as a form variable? I also don't see how the '<dtml-if "mm==test">' conditional could ever be true. I'm sure it works, but I'm not sure how. ;-) In any case, I think you probably want to use a ZCatalog for this kind of search. Brute-force search is a very expensive operation. On Mon, 2002-05-27 at 11:50, hamzatk@3dresearch.com wrote:
that is a good example for trying to use DTML where it should not be used anymore.
i suggest you move this logic into a more appropriate kind of object, such as a python script.
jens
<dtml-in "news.objectValues(['Folder'])"> <dtml-let number=sequence-number path=id> <dtml-if expr="number < _.int(num)"> <dtml-in "objectValues(['DTML Document'])"> <dtml-try> <dtml-call "REQUEST.set('mm', ZopeTime().toZone('GMT+1').strftime('%d%m%y'))"> <dtml-let test=sequence-item> <dtml-if expr="mm==test"> <font face=arial size=-5> <dtml-var expr="_.getitem(mm,1)[0:400]">....<br> <a href="&dtml-ngrHome;news/&dtml-path;"> <img src="images/morex.gif" border="0" width="60" height="23"> </a><br> <dtml-if expr="number < _.int(num)-1"> <hr size="2" width="75%"> </dtml-if> </font> </dtml-if> </dtml-let> <dtml-except> </dtml-try> </dtml-in> </dtml-if> </dtml-let> </dtml-in>
Thanks Jens for the quick response. The main point here is that i am new to python but desperate to know it. I will be greatful if you could assist to convert the dtml code to python script then this will be a starting point for me too. Regards
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Chris McDonough -
Hamzat Kamal -
hamzatk@3dresearch.com -
Jens Vagelpohl