RE: templating system opinions
Just wondering what the best templating system is to use and/or learn. I'm just wondering why no one recommended Embperl. Like Mason, it's more than a templating system, but I find it's inheritance features great. I too have found template inheritance to be pretty important - especially the ability to override enclosing templates. At Turbo10 we went for a strict 'no functional elements' in the template approach. But how do you do things like loops /loops for displaying rows in a report? The content management system models a HTML page (e.g., Object - Master Template - Page - Form - Subform). A presentation script is responsible for inserting the rows into the page and master template. Attributes (e.g., bgcolor) of an enclosing object (e.g., page) are inherited (or overridden) by an enclosed object (e.g., form). Each object is stored in an XMLish file, slurped into a hash, and the keys are merged. Typically a DBI row hash is also merged as there is a 1-1 correspondence between database column names and form attributes. I think the question of templating solution depends on the plan for the content management system ... NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Apache::Registry - String Compaction == Less RAM?
Hi, Apache::Registry slurps in your Perl modules as strings and then evals them. I thought I could save some RAM by stripping out comments and whitespace before the eval step - so I quickly wrote a Registry-like handler that strips comments. Alas, the experiment failed - I saw no difference in RAM usage at all! I suspect that mod_perl is stripping them for me. But isn't a large string allocated in RAM prior to the eval? Are there any merits in a comment stripping pre-processing step in a Registry-like handler? NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
old Apache 1.3 mp1). I did try to go back at one point, builing Apache 1.3 from source, but it had some other problem (maybe, because I used Perl 5.8.0?). But, then I waffled and decided there's also a lot of value in staying current. So, I'm back to 2.0 land, and I'm surviving so far. -=bill -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
How big are your Apache kids?
Hi, I recently managed to get the RAM consumption of my server under control. It had nothing to do with mod_perl ... the culprit was my ISP's config script loading in *tons* of extra modules conditionally. Three versions of mod_php + mod_python all helped to contribute to turn the Apache children into 100 Meg monsters! So a quick: ps -aux | grep httpd, shows RAM closer to 20M: root 29354 0.0 1.5 20064 16488 ? S13:48 0:02 /usr/sbin/httpd - apache 30549 0.6 1.8 22128 18628 ? S14:27 0:00 [httpd] apache 30561 1.2 1.9 23628 20240 ? S14:27 0:01 [httpd] apache 30571 0.6 1.8 22056 18572 ? S14:28 0:00 [httpd] apache 30578 0.8 1.7 21736 18284 ? S14:28 0:00 [httpd] Now I'm wondering how much more RAM I can save? Does anyone have a really lean and mean mod_perl, Apache configuration ... if so, how big are your Apache children? NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
GTop gone missing ...
HI, Some of my Apache children are growing to 100M+ ... I'm now trying to track down GTop so I can install Apache::VMonitor so I can see where all the RAM is going. Unfortunately I'm not having much luck ...with the links from the guide and general searching. Anyone know where I can get a reliable version of GTOp? ... is there an alternative way to seeing what is consuming the RAM? NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Content compression FAQ
HI SLava, Your new FAQ looks really good! I've just got one small suggestion. I've heard that compression can also work with pre-compressing files with: gzip -9 index.html - index.html.gz. And you can then configure Apache Multiviews to serve the pre-Gzipped file. This means you don't have to dynamically zip the file each time and it works with vanilla Apache 1.3. That said, I've been unable to configure Apache to do this properly. Does anyone have a clear solution that can be incorporated into SLava's new FAQ? Nige OK, the preview of a new version of FAQ is available at http://devl4.outlook.net/devdoc/FAQ/compression.html (temporarily). I cannot finish comparison of modules because the other authors are not available for discussions to date. I would probably drop the comparison until better times if you don't mind... Thanks, Slava - Original Message - From: Slava Bizyayev [EMAIL PROTECTED] To: mod_perl Mailing List [EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 1:10 AM Subject: Content compression FAQ Hello everyone again, This thread is supposed to improve Content Compression FAQ at http://perl.apache.org/docs/tutorials/client/compression/compression.html in order to assist Practical mod_perl as Stas suggested. Any of your questions, suggestions, concerns, and/or criticisms of FAQ would be highly appreciated over here. Basically, I'm going to rewrite the preamble, to make clear comparison of modules (a kind of table is expected), and to extend the list of practical questions targeting the interests of Apache administrators mainly. I would highly appreciate if somebody could offer a draft of short and clear explanation of features of Apache::Filter chain vs. Apache::OutputChain for those sysadmins who know nothing about them initially, but have to be able to configure them properly (with appropriate handlers) in the end. Please do not duplicate questions from the thread How practical... to over here. Currently I'm just placing formal redirections from that thread to this one. I will continue to answer all that questions here. Let's go ;-) Slava -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Perl 6 + mod_perl
Hi, I've just been reading Stas + Eric's new book - it looks great - well done to everyone involved! The Apache 2.0, mp2 section is really interesting and when things stabilise here at turbo10.com we will change over to it in production. While reading this section I wondered how Parrot would fit into the interpreter pool scheme available in mp2? Has anyone got any theories on how Perl 6 and mod_perl may merge in the future? Or will Perl 6 Web Applications go down the Java track and execute in JBoss-esque application servers? I know this is really speculative but I think it would be fun to discuss NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Apache is exiting....
HI Paolo, Can you use an eval {}; block? Or maybe solve the bug. Is the @ symbol meant to appear in the font path? NIge Hi all Here's a stripped-down version of a script I use: === use Image::Magick; my $image=Image::Magick-new(size='75x75'); $image-Read('null:white'); my @x = $image-QueryFontMetrics(font='@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf',text='X', pointsize=12); === If the font can't be found, I get this in my error log: === Exception 415: UnableToReadFont (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at /path/to/script line 584. [Thu Feb 27 15:17:07 2003] [alert] Child 8329 returned a Fatal error... Apache is exiting! === Even using an Error.pm try/catch block makes no difference. Pretend for a moment that you have no specific knowledge of the library which causes this problem: is there any black box approach to stopping some library's complaints from shutting down my web server? Thanks Paolo -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Replication + Load Balancing
Hi, It's interesting to hear the experience with hardware load balancers. But I'm also interested to learn how everyone synchronises (replicates) the software on their load balanced servers cron, ftp, rsync? Also does anyone have a variation on the traditional design of a single dedicated database server sitting behind a bank of web servers? The plan at Turbo10 is not to replicate everything - so only the essential information is copied onto the search servers, and stored in MySQL heap tables - this avoids extra trips to the database, and disk seeks. All transactions are first recorded in 'heap' tables (e.g., searchbucket, clickbucket) on the search nodes, then siphoned off to master tables by a dedicated database machine. Nige -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: development techniques
Do you develop with an xterm tailing the logs, an emacs window (or other editor) to edit the script and/or the packages (and on some occassions httpd.conf), and a web browser (on an alternate virtual desktop)? Do you pepper code with : print option: . $option{$foo . br if $debug; Fairly low tech, huh. HI Jim, I do this all the time ... but have tried to extend the tracing technique. I use a Tracer object that: * captures a small amount of meta-info like the caller() * prints out an object's internal state - all objects inherit a toString() method which prints out a DataDumper-like snapshot This is during development ... when something moves to production I try *not* to use traditional logging ... mainly because bugs can be missed, and I can't rely on trawling through the logs to find a bug, instead - all major Exceptions turn into an email which is seen by at least two people. This means bugs don't go undetected for long - the idea is, the more a bug is 'seen/tangible' the better the chance of stopping it (http://london.pm.org/tech_talks/21_nov_2002/nigel/). Finally for testing during development each major object has a test script. For example: testwebbrowser.pl - WebBrowser.pm testtrawler.pl - Trawler.pm The script acts as a test harness for the Object. This has reduced the amount of time spent looking for bugs. The 'test first' methodology, borrowed from XP, seems to be working - the next step will be to put the individual test scripts into a Unit testing framework (e.g., Junit) and run a daily battery of tests ... NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: OSCON ideas - more talk ideas
Let's forgive them, hopefully they know better what they are doing... ;-) Fortunately for us, I'm still here (I mean on mod_perl mailing list) to answer any of your practical questions concerning Apache::Dynagzip implementation. Regards, Slava HI Slava, Good to hear you're still here ... it's a bummer they didn't accept your proposal ... I'm sure others would find it very interesting. I'm planning on using Apache::Dynagzip soon after our next release so I'll report back to the list then. Nige Hi Nigel, OSCON is so far away from the Web Content Compression features. They discarded my proposal to talk about Effective Content Delivery over the Web. You know, O'Reilly itself delivers uncompressed web content to date (indeed, they have mod_gzip and mod_perl installed on Apache): C05 -- S06 GET / HTTP/1.1 C05 -- S06 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */* C05 -- S06 Referer: http://users.outlook.net/~sbizyaye/cgi-bin/pp-slav.cgi/index.html C05 -- S06 Accept-Language: en-us C05 -- S06 Accept-Encoding: gzip, deflate C05 -- S06 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98) C05 -- S06 Host: www.perl.com C05 -- S06 Accept-Charset: ISO-8859-1 == Body was 0 bytes == C05 -- S06 HTTP/1.1 200 OK C05 -- S06 Date: Fri, 10 Jan 2003 02:04:44 GMT C05 -- S06 Server: Apache/1.3.26 (Unix) PHP/4.2.1 mod_gzip/1.3.19.1a mod_perl/1.27 C05 -- S06 P3P: policyref=http://www.oreillynet.com/w3c/p3p.xml,CP=CAO DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa CONo OUR DELa PUBi OTRa IND PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE C05 -- S06 Content-Type: text/html; charset=ISO-8859-1 C05 -- S06 X-Cache: MISS from www.perl.com C05 -- S06 Transfer-Encoding: chunked C05 -- S06 == Incoming Body was 41869 bytes == == real URL = http://www.perl.com/ == == Transmission: text chunked == == Latency = 0.330 seconds, Extra Delay = 1.480 seconds == Restored Body was 41731 bytes == - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: mod_perl list [EMAIL PROTECTED] Sent: Thursday, January 09, 2003 11:55 AM Subject: Re: OSCON ideas - more talk ideas HI, I'd really like to see talks on: 1. Web Server Compression - a comparison, between mod_gzip, DynaGzip Compress etc, pros / cons, SSL compression, and example configurations 2. Application Server Options - a comparison between pure-perl, Apache/mod_perl, POE, SpeedyCGI etc Nige -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster. -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: OSCON ideas - more talk ideas
HI, I'd really like to see talks on: 1. Web Server Compression - a comparison, between mod_gzip, DynaGzip Compress etc, pros / cons, SSL compression, and example configurations 2. Application Server Options - a comparison between pure-perl, Apache/mod_perl, POE, SpeedyCGI etc Nige -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
RE: SSL - mod_gzip - mod_perl = mod_proxy error
HI Adam, Your speed vs time point is a good one. If the network is fast then the time it takes the CPU to do the compression may negate any speed benefits from compressing the message. However, compression is generally worth it because: * HTML compresses well - messages often compress by 80% or more. * Even though your network may be fast - the last mile over a 28.8 K modem can be slow - and compression helps here * The CPU cost of calculating the compression can be avoiding by caching the compressed document in memory or on disk On a side note ... I've had a tough time trying to get all the compression bits and pieces to work together. I've tried mod_gzip and it worked well for non-SSL content ... however, it didn't work with SSL and the only workaround is proxying to a second server ... and I couldn't get this to work with mod_perl. :-( I then looked at mod_deflate but unfortunately this involved re-compiling the Apache source and applying patches etc. Recently I've installed Apache:DynaGzip ... which installed no problem. Apache::DynaGzip, is supposed to work with SSL and can handle chunked dynamic output which is what I'm looking for - I haven't set this up yet but will report my experiences back to the list. NIgel I feel like most of my responses on this list ask 'why' rather than answer a question but: Assuming you have an internet connection between 1 Mb and 10 Mb You're internal network is running at 100Mb with 1Gb around the corner or already going. Why bother compressing stuff when it seems clear that processing power is more of a bottleneck than bandwidth (because in the end, compression is always a tradeoff between computation and the quantity of information coming to/going out of your machine). I would have to imagine that compression would only speed up the actual response time if the external connection is 25% (just a guess) of the internal speed limit. So, in a typical 100Mb internal network, I wouldn't worry about compression unless I could actually deliver 25Mb to the end-user. Of course, if we're paying for more than a 25Mb (10k/month?) connection to the internet, than the cost of a 1Gb network is nominal. All this is moot if the app serves a lan, but still, I think the gzipping would simply make the application more sluggish rather than speed it up (I concede that I have not done any benchmarks) since internal network bandwidth is so cheap. Adam -Original Message- From: Nigel Hamilton [mailto:nigel;turbo10.com] Sent: Friday, October 18, 2002 10:47 PM To: [EMAIL PROTECTED] Subject: SSL - mod_gzip - mod_perl = mod_proxy error Hi, I'm trying to hand all SSL requests to a backend mod_perl server with mod_gzip installed for compression. This means that SSL content is pre-compressed by the backend server before being encrypted by the frontend (Mini How To - below). Apparently mod_gzip and SSL on the same server will not work - this is why I need to pass the request to a proxy to handle the compression. So ... a request on https://turbo10.com:446/index.html (server A) passes to http://turbo10.com:44300/index.html (server B). The file is compressed by server B and passed back to server A for encryption and tranmission to the client. This works fine for static files. BUT Mod_perl scripts seem to fail: https://turbo10.com:446/cgi-bin/splashpage1.cgi The log reports: [Mon Oct 14 21:33:25 2002] [error] proxy:http://turbo10.com:44300/cgi-bin/splashpage1.cgi not found or unable to stat However, when I access the proxy directly, the mod_perl script works fine (no access restrictions just yet): http://turbo10.com:44300/cgi-bin/splashpage1.cgi Any ideas? Is there some weird interaction between mod_perl + mod_proxy? Even better ... is there a way to do SSL compression in mod_perl with only one server? Any help would be much appreciated. NIgel MOD_GZIP WITH SSL MINI HOWTO Version 0.2 February 23, 2002 Tim Behrendsen This document is released into the public domain. INTRODUCTION This document describes how to run mod_gzip over SSL connections using mod_ssl. The method described has been tested with Apache 1.3.22 under RedHat 7.2 (Kernel 2.4.13), mod_gzip 1.3.19.1a, mod_ssl 2.8.5 and OpenSSL 0.9.6b. THE PROBLEM One would expect to be able to just plug in mod_gzip into Apache in the normal way, and have it work with SSL. Unfortunately, due to technical issues with mod_ssl beyond the scope of this document (apparently mod_ssl greedily grabs the result before anyone else has a chance), the easy solution doesn't work. There are workarounds, however, that give the desired result
Re: Do all apache childs create persistant mysql connections?
Hi John, Maybe consider using MyTop (http://jeremy.zawodny.com/mysql/mytop/) to view the state of queries when your server comes under load. It will show what your database is doing to choke your system. Has a table become too big to insert into quickly? Move to an archive. Consider using MySQL heap tables to buffer hits in memory before writing to disk. You can use a cron job to flush the heap table to disk periodically. Do you have another cronjob that runs at 21:00 GMT every day? Is there a lot of contention for the disk at this time (e.g., webalizer, locate)? Move the cronjob to a time when your server is quiet. Just some ideas ... but I hope they help. NIge Hi. We are using Apache::DBI to connect mod_perl to mysql. Suddenly (at about 21:00 GMT every day) the number of mysql processes spirals into chaos. From a stable 8 to 20 processes, it jumps up to 70 processes. This uses up all our 510MB RAM, swap-space gets used, and the system grinds to a complete halt. Sometimes, if all load it taken off (users stop their access), it sorts itself out, and mysql processes return to normal. Other times server load hits 50 and I have to restart mysql. This kills all its processes and the system continues happily. 1) We have no idea why this happens at that particular time. There are no crons that run then, and we think have a finite ammount of users accessing the system who do not do anything different at the time the spike happens. The site is public though, so perhaps spiders could be doing this? Any suggestions? 2) Does Apache create a new mysql connection/process for EVERY child apache process that is spawned? I assume some apache processes are spawned to handle simple non-database actions such as retrieving a graphic or static html file. Because we're using Apache::DBI, does this mean that even these little processes are creating a big mysql process? This is bringing us to our knees. Any help or comments, no matter how obscure, would be greatly appriciated! Thanks everyone, John Cameron -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
SSL - mod_gzip - mod_perl = mod_proxy error
is getting corrupted! A: Unfortunately, IE6 (and perhaps earlier versions?) appears to have a bug with gzip over SSL where the first 2048 characters are not included in the HTML rendering of the page when refresh is pressed. It only seems to happen on longish pages, and not when the page is first loaded. In fact, sometimes it doesn't happen at all. The only current solution is to put a 2048 character comment at the start of your longish pages of all spaces (which compresses pretty well, fortunately). -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: perl script not reloading
Hi Michael, Add the following to httpd.conf: # Stat the modules so changes don't require the server # to be restarted PerlInitHandler Apache::StatINC This module does a file stat on your scripts and reloads if there has been a change. Nigel It seems that as I work on my script, Apache doesn't reload it when the script changes on disk. It seems like it's something that I did because it used to. Is there some common well known thing or set of things one can screw up to make this happen? (if so, it should be documented in the mod_perl_traps man page). Michael Grant -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
mod_perl SSL compression: Apache-Dynazip vs mod_gzip?
Hi, I've been using mod_gzip for the last 18 months and it has worked really well for dynamic pages and static content. However, recently I've needed to use SSL, but I've heard the combination of mod_gzip and SSL is buggy on some browsers. I've checked out Apache::DynaGzip and it looks like what I need - but I'm interested in what other SSL+Compression combinations work best with mod_perl? So here's a little survey ... 1. Are you using http compression with mod_perl? 2. Which compression modules? filters? are you using? 3. Do you also compress SSL content? 4. Do you get bizarre errors on some browsers? 5. Do your pages contain CSS files and .js files? 6. Recommendations? Here is a url that discusses compression options: http://www.innerjoin.org/apache-compression/ Nigel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: [BUG] Losing GET/POST-data
Hi Hakan, CGI::Minimal has a truncate function that picks up invalid CGI data ... this may help. Nigel On Wed, 2 Oct 2002, Wes Cravens wrote: On 02 Oct 2002 15:23 GMT I wrote: Hi! We're developing a perl module for apache/mod_perl, but have encountered a really strange problem. After 'a while' we seem to lose the data sent to the apache-server, at least it never reaches our module. SNIP Recently we switched from using the standard Apache request-object to using the Apache::Request one, for the added functionality, but this has not had any effect at all as far as we can tell, and the bug keeps happening... I ran into a problem that the param parts of a request were flushed when read for the first time... so if you lose them (don't store them) then you cannot access them again. Yep, noticed this myself when re-writing it to check the input, should have posted this first perhaps, but anyway, this is basically how we handle the input: sub handler($) { $^W = 1; # gripe about the little things my $r = shift; my %parm; if ($r-method() eq 'POST') { %parm = $r-content(); } elsif ($r-method() eq 'GET') { %parm = $r-args(); } snipped lots of more code And now, after the re-write with Apache::Request sub handler($) { $^W = 1; # gripe about the little things my $r = shift; my $apr; my %parm; $apr = Apache::Request-new($r); if($r-method() eq 'POST' || $r-method() eq 'GET') { my @keys = $apr-param(); foreach my $key (@keys) { $parm{$key} = $apr-param($key); } } snip of the same lots of more code So.. I can't really see how that would make us lose the parameters, especially since we doesn't lose them all the time, which was the case when I tried to get the same value twice... [Back to Wes] If you are not already, then try $apr = HTTP::Request-instance($r); instead... We use -new now. Since we always only create one instance of it I thought there was no difference. Is instance known to be safer or so? Also got the hint that this could somehow be connected to caching, but since we when we output debug-messages see that handler() is called, with no parameters in $r, I don't see how this could be. Any comments, and suggestions of fix if this might be the problem? Thanks again, Hakan ([EMAIL PROTECTED]) - Hi! I'm a .signature virus! Copy me into your .signature file to help me spread! -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
top for apache? [OT]
Hi, I just found a really cool tool (mentioned in SysAdmin journal). It shows a dynamic picture of MySQL processes just like 'top' (see below). MySQL on localhost (3.23.37) up 2+20:24:55 [09:12:03] Queries Total: 543,555Avg/Sec: 2.21 Slow: 1 Threads Total: 13Active: 1 Cached: 0 Key Efficiency: 97.87% Bytes in: 186,667,281 Bytes out: 227,159,325 Id User Host DB TimeCmd Query or State -- -- --- -- 16776 root localhosttest 0 Query show full processlist 16749search localhost search 1 Sleep 16745search localhost search 2 Sleep 16746search localhost search 19 Sleep 16752search localhost search 19 Sleep 16763search localhost search 23 Sleep You can see what queries are taking too long and kill queries interactively. You can find it here: http://jeremy.zawodny.com/mysql/mytop It would be great to have a similar tool for mod_perl/apache. You could see the memory consumption of children over time, number of requests served, average response time etc. At the moment I end up repeatedly doing things like: ps -aux | grep apache | wc -l to see the number of children and then make guestimates of average per child memory consumption. Does anyone want to code this up over the weekend? ;-) Nige -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: separating C from V in MVC
A) a ridiculously flexible interface that looks sort of like SQL, except where it is SQL, except where it's only sort of like SQL, etc. B) a ridiculous profusion of classes, methods, or both. SQL has its place, and Alzabo merely provides a thin layer on top of it. Trying to jam a thick layer of OO-goodness over relational data is asking for a mess. OO has its place, but if your application is primarily about the database, I don't think that a heavy OO layer on top of that will do HI Dave, Totally agree. My general motto is tiers eq tears ... I've never seen a really comfortable OO/SQL bridge. The OO part almost always dumbs down or hobbles the database. Group bys, order bys, multi-table selects, locking, SQL query plans and index optimisation all rightfully belong to the database but are an anathema to a simple OO/SQL bridge. While disks need to seek and spin ... relational databases will have their place. I sometimes think of a world with unlimited RAM. It's here that OO dreams really come true --- vast pools of objects with hash/array look up speed etc. Until that time though ... I personally code with the database foremost in my mind - and disk seeks a close second - for me the SQL comes first and so I have no problem with large HEREDOCs of SQL in my code. Generally I try to minimise the layers/tiers/abstraction between the front-end and the database - for me OO/SQL abstraction is something akin to 'GOTO considered harmful'. Nige Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: separating C from V in MVC
Generally I try to minimise the layers/tiers/abstraction between the front-end and the database - for me OO/SQL abstraction is something akin to 'GOTO considered harmful'. HI Mark, I'm not sure about a monolithic SQL factory module like the one you describe. Generally, each SQL statement is unique so I've never been able to find re-use benefits here. Also passing parameters to SQL Factory methods involves another change of scope/layer which I think is not necessary. In our system, a programmer maintaining the system will look to the object first and find the SQL bang in the middle - which I think has better re-use/maintenance implications than hidden away in a back closet that's packed full of stuff (i.e., all the SQL). One way I minimise the layers between DB and the front-end is to make sure all fields share the same name as in the database - someone has already mentioned this technique. This follows the design tenet - a unit of data should have only one name throughout the entire system. Perl has a great feature: 'slippery typing' (as opposed to Java's strong). This enables me to pass a database row hash - to an object constructor - to a controller - to a view. In my case the view is typically a HTML template holding tokens of the form: {{database-field-name}}. For example, when a search occurs on Turbo10 the following happens: * Engine Object - contains SQL - returns a DBI row hash * Hit Object - is constructed with this DBI row hash * BrowserMessenger Object - formats Hit in Javascript for tranmission to browser using a Template * Template Object - uses the same field names from the DBI row hash to replace tokens In this way, I try to minimise the interfaces going from the database to the browser - and the SQL stays inside the objects that use it. Does anybody else want to confess to something similar? (-; Nigel I think there's room for middle ground here between mapping OO directly to SQL and having SQL in heredocs in your code. What we tend to use is a object that works almost as a SQL factory. We never have SQL directly in our code, but rather all this is placed inside a seperate module.that knows a few things about itself - e,g, what database and table we're using for this run. This can be then used to spit out SQL or run the query and return the results. The key aspect is that anytime you feel you need to write some SQL you should feel free to add more SQL to this module - not limit yourself to waht's already avalible. The advantage of this is that we get better reuse in out of our SQL when we need the same function called from many places, and we can reuse the same SQL on similar tables/databases for different runs. Another advantage is that should we ever want to change the database all our SQL is in a few modules and we can make sure that we change all our SQL. Mark. -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
mod_perl2 Web Application Standard?
Hi, All this talk of MVC and a universal despatch mechanism has started me thinking about Java Web Applications and how they are bundled into a standard configuration (e.g., Java's Servlet standard 2.3) Would such a standard (albeit optional) be useful for mod_perl2? Generally standards run contrary to the TMTOWTDI approach of Perl but there are some advantages in a 'minimal' mod_perl web application standard: * ISP's could install mod_perl applications in a uniform/consistent way - (e.g., the standard should prevent name space collisions etc.) * A subset of mod_perl methods could be selected as a basis for the standard allowing other 'container' servers besides Apache (e.g., like http://jetty.mortbay.org - except in Perl not Java) * Software companies (not sure who) could provide replication/clustered/load balanced solutions based on this standard * Application configuration/management tools could be used to administer mod_perl application(s) on the same server(s) * We could share 'mod_perl' applications on CPAN more easily/quickly Ideally, I'd like to download a single mod_perl archive file (e.g., application.mod) place it in a 'standard' application directory and then point my browser to the new application. Is this something that could be considered with the next release of modperl2? I'm thinking of something that is really 'lite', not too prescriptive, but achieves the objectives above. Nigel Ward Vuillemot wrote: I know we are straying WOT, but I would love to get a better feel for XML, XSLT and AxKit. Barrie Slaymaker has written a couple of articles on perl.com that serve as a good intro to AxKit. - Perrin -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Apache2/mod_perl2 an order of magnitude more powerful?
Hi, I haven't installed Apache 2.0 yet but I like the sound of 250 worker threads set as the default! I would love to run 250 Apache children on my linux server but I just don't have enough memory (50 children max). 250 http server threads running concurrently would be an order of magnitude more powerful than my current set up. Have I got this right? or am I missing a big catch? NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Apache2/mod_perl2 an order of magnitude more powerful?
250 http server threads running concurrently would be an order of magnitude more powerful than my current set up. Have I got this right? or am I missing a big catch? No and yes in that order. Your computer won't be any more powerful, no matter how many threads you run... Yes. OK. But having 250 worker threads instantiated in memory and ready to use the CPU is surely still better than 50 pre-forked servers? -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
[OT] Encrypting Embedded URLs
Hi, I'm looking for a two-way cipher to obfuscate URL parameters safely and succinctly (not too many extra characters). # For example, something that converts this URL: $url = 'http://www.foo.com?a=1212u=http://www.foo1.com?a=12323'; # to an encoded URL with the parameters obfuscated print Simple::URLEncode($url); # that looks like this: http://www.foo.com?params=aJHKJHKJHKJHHGHFTDTDGDFDFGDGHDHG879879 A built-in checksum would be a bonus ... any ideas? Thanks Nigel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: [OT] Encrypting Embedded URLs
# For example, something that converts this URL: $url = 'http://www.foo.com?a=1212u=http://www.foo1.com?a=12323'; # that looks like this: http://www.foo.com?params=aJHKJHKJHKJHHGHFTDTDGDFDFGDGHDHG879879 Why are you trying to do this? What's the goal here? HI, So it's not easy for someone to read the parameters ... and also because sometimes embedded URL's parameters are not interpreted correctly - for example the a parameter below: $url = 'http://www.foo.com?a=1212u=http://www.foo1.com?a=12323'; Nige -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: OT: Status Page
Hi Rasoul, We display a status bar while processing credit card transactions at Turbo10 (http://turbo10.com). The Bank takes 1-5 seconds to respond so in the meantime we show an animated status bar GIF in a pop-up box - when the page is 'onunLoaded' (Javascript event) the progress bar pop-up is closed. A pop-up is useful in this situation because keyboard/mouse focus is taken away from the credit card processing screen which reduces the likelihood of the user pressing submit twice. Regards, Nigel Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster. Folks, please excuse this off topic thread, but I thought since a lot of you work in creating a informative user experience, some of you may be able to help me. I am trying to create a status page, the kind that shows a horizental status bar that looks to work in real time and changes as events happen behind the scenes. EToys had it when confirming a cc sale, or expedia has one during the search. Can some one direct me as where would I find info in creating one of those pages. are those applets? Again, accept my sincere, humble, unreserved, and advance appology. Thanks in advance -r --
Re: mod_perl Cook Book
HI, There is a section on performance tuning which is fantastic ... it gives practical examples of how you can monitor memory usage etc and tips on how to serve maximum hits per second. In the past month I've been wavering about mod_perl and have considered moving to Java servlets but this book has reminded me of the benefits of mod_perl and I'm sticking with it. Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster. On Fri, 5 Apr 2002, Rasoul Hajikhani wrote: Hello folks, Has anyone purchased the mod_perl cook book from this list? If so, what do you think of it? Is it a good buy? Appreciate feed back. I have two copies, as the one at work keeps getting borrowed. I would say it's different to the Eagle book - it takes a different tack (which is kinda the point). I find both books useful - the Eagle book for explaining the Apache request cycle very clearly, and the Cookbook for explaining some of the nuances of mod_perl very clearly. Basically the Cookbook is much more about solving specific problems than the Eagle book, and as such is much more useful long term and short term, and I also found the explanations a bit clearer in the Cookbook. So I'd get both, but the Cookbook first if you're new to mod_perl, and then the Eagle book if you're still confused about some issues. I promised Geoff I would do a full review, and I'm doing an OS upgrade this weekend, so perhaps I'll get a chance to go over the bits of the book I've missed so far and post the review somewhere. --
[OT] Layers/interfaces/tears, was: Not embedding SQL in perl
Here Here I think calling for an abstraction layer for the sake of it is crazy design. I always thought modelling was about getting as close to the subject as possible - distilling the essential - nothing more, nothing less. The more layers/interfaces/tears involved the more shaky a foundation - and abstract a solution. Building software is not like building a bridge --- over-engineering by pouring more cement doesn't help. The costs for this extra abstraction can include: extra debugging, extra complexity, hobbling functionality (e.g., no group by clause etc.) and extra maintenance (of the abstraction layers). I still think a well designed relational model is the most solid foundation a system can have - and the less layers/interfaces/tears on top of that the better. Nige On Wed, 1 Aug 2001, kyle dawkins wrote: kd Well, yes and no. I was citing that example as *another* reason to keep kd SQL out of your application-level code. kd If you do, as Henrik suggests, write pure SQL92, then obviously you kd wouldn't need to wrap all your SQL in ifs like they did with kd wwwthreads... you could just switch out MySQL and switch in Filemaker kd Pro if it supported SQL92 and had a DBD module :-). I maintain, kd however, that SQL embedded in application logic is evil in all but the kd simplest of scripts. Putting it in middleware is mandatory; I don't take kd issue with that. I am not against removing redudancy and creating function/methods of code that is used more than once so that you don't do the same SQL query at several places in your code. But that is good programming practices within your own classes/modules. But to abstract everything to a SQL class only moves your SQL there and probably causes severe limitations when wanting to do something advanced Maybe if you were writing a data abstraction layer and API for some other programmers, but if you have a database that you know only your script will use, writing an extra abstraction seems very overkill. I could see a use for abstraction if we were going to support several different query languages, but as long as we only use SQL my belief is that DBI is abstraction enough to maintain DMBS interoperability. And of course only use SQL92. Someone once said that more abstraction levels than four (4) is counter productive. I can see both sides in real life. It all comes down to what kind of application development you are doing. And writing your SQL in your main Perl code now does not make it impossible in the future to abstract it to it's own class. But I have seen whole applications go under because they have been so heavily abstracted that in the end no one is even sure what happens anymore - and then of course - class/object operations in Perl 5 are not the fastest either. Regards, Henrik -- Henrik Edlund [EMAIL PROTECTED] http://www.edlund.org/ You're young, you're drunk, you're in bed, you have knives; shit happens. -- Angelina Jolie
1 Billion Bug 1BB - [OT] UNIX timestamp hits 1,000,000,000 thisyear!
HI, I'm waiting to see how quickly someone starts the 1 Billion Bug (1BB) Consultancy ... scary. NIge Nigel Hamilton __ http://turbo10.com Turbo10 Search Engine Search Fast. Browse Faster. On Fri, 9 Mar 2001, Tim Bunce wrote: On Fri, Mar 09, 2001 at 12:44:59AM -0500, Bill Desjardins wrote: Just as a FYI about something that caught my attention recently. This year on Saturday September 8, 2001, the unix time stamp flips to 1 billion and gets another digit going from 9 to 10 digits. Not sure if anyone else but me is using the timestamp in ways that were set to 9 digits, such as DB column int length or in strings of fixed lengths, but these possibilities should be looked at just in case they could fail when the time changes to the longer int. Another common bug-waiting-to-happen is sorting the unix time stamp values as strings instead of numbers. Tim.
Microsoft's Remote Scripting - modperl equivalent?
Hi, Microsoft's Remote Scripting allows Javascript events to be passed to an Applet which in turn calls a server-side function. One advantage: form validation can happen without the need to load a new page. There are two parts to it - the Javascript-Applet interface and the Applet-ModPerl connection. Is there a mod_perl module out there that does this? If not, is such a thing useful? Regards, NIge Nigel Hamilton __ http://turbo10.com Turbo10 Search Engine Search Fast. Browse Faster.
Re: httpd takes 86 MB memory
Hi Philip, That seems like too much memory per httpd. Does the memory usage grow overtime, or is it static? If it's static, then the BIG data structure(s) you're storing in RAM may need to go to disk. If it grows over time, maybe a data structure is unintentionally being treated as a global variable --- because the variable persists between requests the data structure may keep growing and growing. The solution may be to lexically declare the variable with 'my' so that it only survives for the scope in which it is declared. If there is no programming solution ... you can also set the MaxRequestsPerChild in httpd.conf so that after a certain number of requests the child dies and frees its memory. NIge Nigel Hamilton On Sun, 18 Feb 2001, Philip Mak wrote: Recently, my machine got an upgrade from 128 MB RAM to 386 MB RAM. The modperl enabled httpd process used to take up less than 10 MB each. But now, after the memory upgrade it is suddenly taking up 86 MB. Here is an excerpt from "top" (sorted by memory usage): PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND 3746 tuxedo15 0 139M 128M 964 R 0 95.6 34.1 45:22 wusage 7257 nobody 0 0 103M 86M 84944 S 0 0.0 22.9 0:00 httpd 7253 nobody 0 0 102M 86M 85028 S 0 0.0 22.9 0:00 httpd 7263 nobody 0 0 102M 86M 85032 S 0 0.3 22.9 0:00 httpd Does anyone have suggestions on how to find out the problem/fix it? The httpd.conf has not been modified in a month, and the memory upgrade was done just three days ago. So, AFAIK the only thing on the machine that has changed is the amount of RAM. -Philip Mak ([EMAIL PROTECTED])
Re: Fwd: [speedycgi] Speedycgi scales a better benchmark
Hi, I think some of the 'threatened' replies to this thread speak more volumes than any benchmark. Sam has come up with a cool technology it will help bridge the technology adoption gap between traditional perl CGI + mod_perl - especially for ISP's. Well done Sam! NIge Nigel Hamilton __ On Fri, 22 Dec 2000, Ask Bjoern Hansen wrote: On Thu, 21 Dec 2000, Sam Horrocks wrote: Folks, your discussion is not short of wrong statements that can be easily proved, but I don't find it useful. I don't follow. Are you saying that my conclusions are wrong, but you don't want to bother explaining why? Would you agree with the following statement? Under apache-1, speedycgi scales better than mod_perl with scripts that contain un-shared memory Maybe; but for one thing the feature set seems to be very different as others have pointed out. Secondly then the test that was originally quoted didn't have much to do with reality and showed that whoever made it didn't have much experience with setting up real-world high traffic systems with mod_perl. - ask -- ask bjoern hansen - http://ask.netcetera.dk/ more than 70M impressions per day, http://valueclick.com
Re: Mod_perl tutorials
Hi, I'm for the minimalist slides approach ... I often think there's an inverse relationship between powerpoint buzz and the speaker's presentation skills --- a good speaker knows that *they* engage the audience not their slides. Some of the best technical presentations I've seen use almost *no slides* and the detail is contained in handouts. Nige
Re: Help me beat Java.
I have written a awsome mod_perl module for Apache and now my companie wants to transform it to Java (ik). Nothing personal against java but 95% of the program is regular expressions. Perl is king in this area. In java they are using Oroinc 3rd party classes for the regexs. With some prliminary bench mark test of non mod_perl perl and Java, perl won being 12-20 times faster. But now they want to do super tuning and also compare Resource consumption between JRun/Java Servlets and Apache/mod_perl. My main concern is the fact that apache/mod_perl child proccess can be as big as 12 MB. Specifically my question is 2. Is there a way to lower this memory consumtion? I haven't had time to look into this, but Gunther mentioned a new module CGI::SpeedyCGI this enables persistent perl processes, outside of Apache. Could you reduce the number of Apache Children and replace them with SpeedyCGI backends? This should save memory and give you more waiting processes to answer requests! I haven't tested this but would be interested to know if anyone has done this comparison? I suppose it depends on whether or not you are using Apache:: modules that need to be tied into the server --- if not, then maybe SpeedyCGI will save you some memory? NIge
More Speed - mod_perl Module for HTML Compression
Hi, I'm trying to reduce the amount of data sent from server to browser by using compression --- hopefully accelerating the time to serve a page. Does anyone know of a mod_perl module that compresses HTML and a companion Javascript procedure that decompresses the data on the client-side? I know there are Gzip modules that zip files on the way back to the browser ... but I'm after something that zips on the server and decompresses transparently in Javascript across all browsers. Ideally I want to do: document.write(uncompressed-contents) in Javascript on the client-side. Has anyone come up with something for this? Also for average-sized files, does the time taken to perform the decompression/compression negate any speed increase gained by reduced file size? Nige Nigel Hamilton __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache::VirtualHostRegistry
Hi, Going along ths lines of sharing mod_perl between users for ISPs is there a median position that tempers security concerns/support costs/hassles etc that a CPAN module could fill? I'm thinking of a module like APache::Registry but it segments the namespace/memory netween virtual servers --- a sandbox that each virtual host is kept in? NIge Nigel Hamilton __ http://e1mail.come1mail - Encrypted 1st Class Maile1mail: 1001 On Fri, 17 Nov 2000, Gunther Birznieks wrote: I think these are good points. However, to some degree, if this is an attempt to allow an ISP protection, it's not because most ISPs offer CGI access to their customers. In addition, the moment you give mod_perl access to a developer they have the rights to do a LOT of stuff that goes beyond putting PerlHandlers in an htaccess file. It's possible to go through the Apache::Registry package and walk the subroutine tree of precompiled scripts and conceivably figure out stuff about other people's scripts. Actually probably easier to just figure out what packages exist in memory and walk the memory and variables directly. If some of those variables are config vars, then oh well. In fact, I should think it is conceivable that one mod_perl script could theoretically replace another mod_perl script within the Apache::Registry by manipulating the global variables within Apache::Registry. So in other words, if you can't have a semblance of trust your developers against each other, then mod_perl simply cannot be configured in a way that developers can truely share the same web server. However, I don't think many people advocate sharing mod_perl web servers in teh real world with apache 1.3. When Apache and mod_perl 2.0 come out, I suspect the new architecture will allow very cool things like Perl Interpreter segmentation among virtual hosts. But until that happens, there's really not much you can do. It seems to me that mod_perl wasn't really designed for safety against your own developers doing something malicious. And most if not all people pretty much run their servers that way. Most people who run mod_perl run it as their own dedicated server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Virtual Hosts, Name Space Clashing and Apache::Registry
Hi, I'm encountering name space clashes with two virtual hosts on my server while using Apache::Registry. Both sites use a settings module that returns a hash of configuration parameters (e.g., fgcolour = blue, bgcolour = white). The settings module is called: settings.pm. There are two versions of this module stored in different directories (i.e., /site1/cgi-bin/settings.pm + /site2/cgi-bin/settings.pm ). The problem is, periodically the sites swap look and feel. Intermittently, a site suddenly appears cross-dressed in the other's colours etc! I'm using Apache::Registry as the handler. My understanding was that Apache::Registry creates a unique name space for each subroutine it loads (e.g., Apache::ROOT::cgi2bin::settings etc.). I could just rename the module but I'd like to know why things are going awry. Are global variables not included in this unique name space? I'm using lexically scoped (my) variables to store the settings. For example: use settings; my %settings = settings::getSettings(); Any help would be much appreciated. NIge
RE: database access
HI Jason, Have a look at the source of Apache::DBI. An important part of the module is a ping method that ensures the connection handle (e.g., $dbh) doesn't go stale. You can write your own ping method by doing something like: $dbh-do("select 1") Which should return true (i.e., 1) if your handle is OK (unless your using Interbase where 'select 1' blows up!! ). We maintain persistent database connections per child without using Apache::DBI. Each child has its own lexically scoped database handle. We periodically ping the handle to make sure it is still alive - if it isn't we create a new connection. This system works because we only talk to one database with one user. If you have lots of databases and/or database users you will need something more exotic. Regards, NIge
HTTP Mod_Perl mini-server
Hi, I'm contracting for an Ad Serving company and we were mooting the idea of writing our own lean and mean web server for serving the Ads. We would like to hold all the Ads in memory (each Ad is less than 20K). The next thing is to create a pool of mod_perl-esque processes that will handle the AD requests and also hold persistent connections to the database. I would like to write this mini-server in perl ... but maybe a threaded programming language is better? Does anyone know a good process/threading model for handling the requests and passing them around? Will we see a significant performance improvement in any event? NIge
Re: Proxy setup w/ SSL
Everyone, I have successfully setup the proxy system outlined in the guide, and it seems to be working well. In my instance, the front-end httpd has mod_proxy mod_rewrite, while the backend is only mod_perl. I also have a seperate instance of stronghold/mod_perl for SSL connections. What I would like is to add SSL to the frontend servers and ditch stronghold all together. I'm interested in suggestions for how to do this. Should I try mod_ssl, raven, etc? I am trying to have only 2 servers running instead of three. Does anyone have experience in this area? Hi, Also, does anyone know a way to speed up SSL somehow? NIge
Re: Session woes -Anyone Please help.????
HI Jitesh, I do exactly the same thing ... but I pass session variables using a combination of methods. Inserting a hidden field into subsequent pages: input type = "hidden" name = "sessionid" value = "1232139102831" Or you could append the sessionid to a URL: http://www.yoursite.com/cgi-bin/yourcgi.pl?sessionid=1232139102831 Failing that, you could create a hidden frame (i.e., size = 0) and store the sessionid in a Javascript variable: form onSubmit = "this.action = this.action + '?sessionid=' + parent.hiddenframe.sessionid;" The javascript will append the sessionid when the form is submitted. You might choose the third option if you wanted to keep the sessionid semi-secret and you only need to access the session variable some of the time. NIge Nigel Hamilton __ http://e1mail.come1mail - Encrypted 1st Class Maile1mail: 1001
Re: Help needed for using Apache::DBI
Hi, I've had the same bug for the past 3 weeks. As far as I can tell mod_perl has been installed fine (EVERYTHING=1 etc..) so I'm at loss to explain why ... A couple of other people have mentioned this bug recently too ... has anyone solved it? NIge On Mon, 17 Jul 2000, PHANI MADHAVI wrote: Hi All, we have installed Apache::DBI module ( system os is linux, web server apache, running mod_perl and mysql is rdbms) in our systems. But it is not working. When i try to compile a sample file to test db connectivity using Apache::DBI, it does not work. Same thing works if I use DBI. The error is " can't locate object method "module" in the DBI.pm file" We checked the DBI.pm file and there is one statement which goes like this: if ($INC{"Apache.pm"} and Apache-module("Apache::Status")); And we searched for Apache.pm. We could find the file but not the "module". Please let me know how should we proceed. Regards, Madhavi -Original Message- From: Vincent Bruijnes [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 16, 2000 12:30 AM To: Sam Carleton Cc: [EMAIL PROTECTED] Subject: Re: getting mod_perl configured on FreeBSD Well i had the same problem on freebsd too. first goto mod_perl directory: perl Makefile.PL PREP_HTTPD=1 USE_APACI=1 then make make test and make install Goto your apache directory ./configure --prefix=/www --enable-shared=max --activate-modules=src/modules/perl/libperl.a --disable-shared=perl then make and make install. and voila your apache is configured as statically mod_perl and you have DSO enabled so you never need to recompile apache if you want to add optional modules. Good Luck and let me know if I can help you any more. Vincent Bruijnes At 21:21 14-7-00 -0400, you wrote: I have successfully gotten Apache/mod_perl to compile under Linux many a times. This is my first attempt at compiling it on FreeBSD and I am having problems. The problem is that when to do the "make test", apache never starts up. I had once run into this on Linux and that was because the .makepl_args.mod_perl was pointing to a non-existing layout file and I did not catch the error from the "perl Makefile.PL". But I have looked and look at the output of the "perl Makefile.PL" and see nothing wrong. I am going to post the output of "perl Makefile.PL", along with my .makepl_args.mod_perl and my layout file in hopes that one of you can find my error. Thanks output from "perl Makefile.PL" Will run tests as User: 'nobody' Group: 'wheel' Configuring for Apache, Version 1.3.12 + using installation path layout: maineville (/usr/src/apache.config.layout) + activated perl module (modules/perl/libperl.a) Creating Makefile Creating Configuration.apaci in src + enabling mod_so for DSO support + id: mod_perl/1.24 + id: Perl/5.00503 (freebsd) [perl] Creating Makefile in src + configured for FreeBSD 4.0 platform + setting C pre-processor to cc -E + checking for system header files + adding selected modules o rewrite_module uses ConfigStart/End enabling DBM support for mod_rewrite o dbm_auth_module uses ConfigStart/End o perl_module uses ConfigStart/End + mod_perl build type: DSO + setting up mod_perl build environment + adjusting Apache build environment ** Error: Cannot build mod_include with Perl support (USE_PERL_SSI) ** ** when mod_perl is compiled as DSO because of cross-module calls. ** ** Ignoring PERL_SSI flag now. ** + checking sizeof various data types + doing sanity check on compiler and options Creating Makefile in src/support Creating Makefile in src/os/unix Creating Makefile in src/ap Creating Makefile in src/main Creating Makefile in src/modules/standard Creating Makefile in src/modules/proxy Creating Makefile in src/modules/perl Reading Makefile.PL args from ../.makepl_args.mod_perl Will configure via APACI cp apaci/Makefile.libdir /usr/src/apache/src/modules/perl/Makefile.libdir cp apaci/Makefile.tmpl /usr/src/apache/src/modules/perl/Makefile.tmpl cp apaci/README /usr/src/apache/src/modules/perl/README cp apaci/configure /usr/src/apache/src/modules/perl/configure cp apaci/libperl.module /usr/src/apache/src/modules/perl/libperl.module cp apaci/mod_perl.config.sh /usr/src/apache/src/modules/perl/mod_perl.config.sh cp apaci/load_modules.pl.PL /usr/src/apache/src/modules/perl/load_modules.pl.PL cp apaci/find_source.PL /usr/src/apache/src/modules/perl/find_source.PL cp apaci/apxs_cflags.PL /usr/src/apache/src/modules/perl/apxs_cflags.PL cp apaci/mod_perl.exp /usr/src/apache/src/modules/perl/mod_perl.exp PerlDispatchHandler.enabled PerlChildInitHandlerenabled PerlChildExitHandlerenabled PerlPostReadRequestHandler..enabled PerlTransHandlerenabled PerlHeaderParserHandler.enabled
Perl Registry ... Memory consumption.
Hi, I've been trying to setup mod_perl in an Apache/Red Hat Linux/mySQL environment for the last couple of weeks. When running Apache::Registry on production, mod_perl chewed up all the available memory (at that stage only 64 Meg) and the system started to use swap memory. So we doubled the memory to 128 Meg and over the next 10 minutes of using the site (having restarted the server) we watched as all the extra memory was used up and it went back into swap! So here are some questions: 1. What is a 'ball-park' figure for mod_perl memory requirements? 2. What is the entry level spec for a mod_perl/Apache/Linux server? 3. Should I reduce the number of Apache child processes (currently 10) ... to reduce memory consumption? 4. Will mod_perl always ramp up its memory consumption to whatever is available? 5. Should we throw money at the problem and just buy more memory? 6. I have not been able to get Apache::DBI to work. Will Apache::DBI significantly reduce memory consumption (every script opens a DB handle for session checking)? Any help, and war stories that you may have would be much appreciated ... Nige On Sun, 2 Jul 2000, Christopher Suarez wrote: I'm running rh linux 6.2 on a laptop and have tried for sometime to get apache::DBI runnning. modperl wokrs fine with apache but when I add the line PerlModule Apache::DBI to srm.conf, httpd.conf or "use Apache::DBI" to startup.pl and then PerlRequire /path/startup.pl to httpd.conf it won't work. apache will start ok(saying it's using mod_perl) but won't shut down ok and error_log doesn't say anythings wrong. the webserver won't response on contacting 127.0.0.1 in a browser it'll response connection refused. versions: apache-1.3.12-2 apache-devel-1.3.12-2 perl-2.00503-10 perl-DBI-1.13-1 perl-DBD-msql-mysql-1.2210-1 perl-Apache-DBI-0.01-2 perl-Apache-DBILogin-1.5-2 perl-Apache-DBILogger-0.93-2 perl-Apache-RedirectDBI-0.01-2 mod_perl-1.21-10 strange???
Newbie: Apache::DBI Directive bug
Hi, I've got a showstopper bug ... Whenever I place the directive to load Apache::DBI in httpd.conf ... I get a config file syntax error. The directive is: PerlModule Apache::DBI I compiled mod_perl with EVERYTHING=1 ... can anyone tell me why this would be the case? Thanks Nige p.s. also I've seen 'startup.pl' mentioned in FAQ's and in the list ... I'm interested in seeing an example startup.pl for DBI .. and how the Apache server 'sources' this file at startup.
I've been framed! Losing target frame under Apache::Registry
Hi, I've just installed: mod_perl (1.24), Apache (1.3.11) on Red Hat Linux (5.1). As far as I can tell, mod_perl is installed OK. The location directive in httpd.conf contains: PerlSendHeader On. I'm now attempting to migrate my .cgi scripts to run under Apache::Registry. Here's the BUG. Imagine two frames: +---+ | A | +---+ | | | B | | | +---+ Both document A and B are the results of a CGI script. Frame A contains a menu. When a user chooses an option from the menu ... the form is submitted and B is the target frame for the result. Under normal CGI this code works fine. However under mod_perl (Apache::Registry) the script that generated frame A is re-executed and the output appears in frame B! Two menus now appear, one in frame A, the other in frame B. How does the browser (Netscape on Linux) get confused about the target frame for a script? Is there a race condition? How does mod_perl affect the target frame of the script? Any help would be much appreciated. Nige p.s. these scripts work fine under normal CGI ... so I suspect mod_perl is making the difference.