Re: Mod_perl vs mod_php
Does anyone have any mod_perl vs. mod_php benchmarks? Given the fact you are the good programmer either would be about the same. If you can't program your way out of a paper bag, benchmarks won't help you. Benchmarks are for managers, are you the one? pavel
Re: mod_perl advocacy project resurrection
On Sun, 10 Dec 2000, Gunther Birznieks wrote: I'm currently using the Tomcat at work, and I have to say that although I really love perl and mod_perl, there are real advantages to using java. Over the past couple of years that I've been mostly lurking on this list there have been a couple common threads: 1) Memory Usage: embedding the perl interpreter on every process uses lots of memory. This of course can be tweaked and isn't as bad on good OS's, but it is a common thread. You can do the twostage server if you are short on memory, speed is important and usage of active content is relatively low. Setup a mod_proxy and stripped down apache for port 80 and mod_perl for port 8080 for example. Proxy certain urls to the 8080 and you are good. Set low number for the mod_perl items, to avoid thrashing. I'd see where Java is weak, integration wise like 2 MB per process and not even integrated string processing. 2) Sharing information between the processes. There's lots of different ways to do it, but none really jumps out as an end-all solution. Java movement has stretched out itself too thin, they did not identify themselves with a particular niche, and so we did it for them, where they don't really excell either - web applets, flash is more fit for that sort of thing. Perl is not very known for doing gui but spreading out knowlege about perl/tk helps. Which is just as good as AWT(? not sure of the name) With a system like Tomcat running in a jvm outside of apache, you only have one jvm, and you get things like being able to share a cache between all sessions alot easier. So is with FastCGI, reinventing the wheel man is not a good thing. Sun people are on this thing to rewrite the world and put a Sun stamp on it and make everybody use it. Whahoo. I personally find the configuration of mod_perl to be more straight forward than Tomcat, but I do see some advantages to that system (I'm sure there are some speed disadvantages to the tomcat communcation, but haven't done any benchmarks). Try FastCGI, it is really fast if you can do multiplexing. Besides the fact, I will write apache C modules if I need speed, not use some unproven languages to handle maximum loads, with lowest response time. That being said, I wonder how difficult it would be pull the perl intepreter out of mod_perl and run a perl stand-alone multi-threaded daemon which listens for mod_perl api calls... :) This is very similar to SpeedyCGI + mod_speedy. Although it's more like a servlet engine model than actually get access to Apache API. SpeedyCGI is not web server specific (except the mod_speedy module). Good one. However would you really get the advantage of performing configuration manipulations on the fly? Or dynamic generation of the configs form templates and lists of values? Things I would never even try with java: 1) Talking any client/server protocol other than URLs. The perl mail/ftp modules are so easy to use and they work great. I don't even want to think about writing to syslogd from inside java... :) There have been public domain libraries to write to syslogd in Java for a long time. The only problem with Java in this regard is that there is no CPAN. But if you search on the net, you can usually find something in Java that has the equivalent to a CPAN module that deals with networking as Java makes networking quite easy. Sun was not onto community thing anyways, they're corporation, and giving up a control something they spend money on, will give chills to the managing types that are not for the OS thing. No CPAN is an oversight for the Java people, but really how can they implement it? Java runs across many platforms and VMs for it are written by many companies. If one dares to do something like that. For one they have to figure out how not to breach security of systems where people will be installing custom java classes. Java like windows2000 was touted for the security and CPAN like thing will bring some bugs and holes into the frame work I am almost sure. happy hacking, pavel
RE: [certification]
On Sat, 9 Dec 2000, Gunther Birznieks wrote: However, the fact is that their can be other distinguishing factors on a CV, but to ignore those factors INCLUDING certs is just stupid unless you have the luxury of only having some ridiculously low number of CVs to look at and can spend that time interviewing people because you only have a few straws to grasp. Perhaps you are right if a department is hiring 50 people,get 500 resumes, they are bound to get 10-20% defective or non fitting employees. Certifications perhaps is like firewalls. Certifications/contributions to CPAN, should be use a perhaps a priority items. Such way you can compose a set of people, where each is guaranteed to be able to somehow contribute to a team development, other is when and how these people will be able to fit with one another. Also the other aspect, is work ethics. I can hack perl modules like crazy, but I don't I do diagrams, see that I would have inside out understanding of a problem and possible solutions, and then I code. 90% of people I know just sit down and start to code until it is done. Rewrite the project a few times perhaps. If you want just grunts 'shortlisting' is perfectly fine. Difference between perlfect and alright is very thin one. just 2c Pavel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
apache configuration error logging
hi. Here is situation: 1. I have written Auth, Authz and redirect handlers for user control. They take in information from httpd file via PerlSetVar statement for configuration purposes. They also log information into error logs via $r-log_error 2. I have integrated them to protect certain Location on the VirtualHost. ErrorLog was setup correctly, everything works fine. 3. I take all the stuff copy over and change approprite paths, and create new VirtualHost directive. ErrorLog is setup correctly. After I restart webserver, there is no messages from my modules into the appropriate error.log or any other error log. How do I fix this? It seems that as I add in the ModPerl authentication code into the new VirtualHost directive, errors stop coming into error log, regarding that particular VirtualHost, but other continue to work fine. Is that weird? The code in new VirtualHost functions correctly, besides inablity to append to the error.log of the virtual host... Pavel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTP Mod_Perl mini-server
On 3 Dec 2000, Greg Stark wrote: Perrin Harkins [EMAIL PROTECTED] writes: On Fri, 3 Nov 2000, Vivek Khera wrote: Lately I've been getting very interested in using solid-state disks for high-performance issues. They're expensive, but if you need that much speed, they're worth it. Are they? I tried one once, and it wasn't any faster than my normal disk because I had so much RAM it was all getting buffered already. If you don't have enough RAM, it might help, but I suspect these are more expensive than equivalent amounts of RAM. Solid state disks are very effective for particular applications like mail spools and database logs where the application waits for data to be flushed to disk before continuing. For most normal applications the same effect can be obtained by adding RAM and/or playing with tools like memfs. SCREW solid state disks. Get more ram. Depending on the size of your website it might be smart to make a ramdisk of a 200MB in size... would be lightning fast, and apache won't even know about it. For database application with limited growth and size it might be very good thing to do, like a dynamic website, from a content database, that is mirrored from harddrive to the ramdisk on regular basis. Content editing is done straight to the disk, but lock tables and dump the database, and go on like a happy camper... =) NO RAID will be faster than RAM, and if it is, it will cost a price of the new prosche and latency will never be anywhere near ram... so I'd just give it up right now. Raid is good for large amounts of data, but if your site is not over 500MB altogther, just get a linux(or BSD) box fit it with 1G of ram 8G IDE drive and you will be faster than amazon, provided, that you have enough processing power. That is all. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: i am looking for mod perl tutor
On Wed, 22 Nov 2000, mohammed abdul bari wrote: Hi, I am looking for mod perl tutors. I have a pretty good knowledge of perl but just a lil bit about appache modules. I need some one who could spare a day or 2 with 1 or 2 hours a day to get me basics. I live in santa clara. Really if you want to code opensource stuff, you have to start learning on by yourself. It is not easy, but as they say easy come easy go... if you do with tutor. Pick up the Eagle Book, Programming Perl, Perl BlackBook and some C manuals and start to sweat away at getting simple stuff to work. If you really want to learn how to do good web application developement, the Eagle Book (Writing Apache Modules in C and perl?) is still really the resource to learn from to make good informed decisions on how to build a particular site. It teaches where to use Java script, Perl CGI, mod_perl and plain C modules that are compiled in perl. Here's another trick, every time you have a question try to scan as many sources as possible, that way you most of the time will get rounded knowlege on a particular question. If you do it like that, you will start make connections on what belongs to what and how one relates to the other. Once you get basic idea how the web works, and how mod_perl fits in there then you can send some questions up here. I as many people here are, like to help, but would not toleration idiotism, sort of like some people like to say well, can you just upload it into my head and I'll use it some time.( You can say that I am bitter, cuz we just hired in the manager and she is tries to stir the pot, as if she knows what she is doing, and telling us that what we did is not best decision, and that there might be better way to do it, and then goes off to ask her friends via e-mail and then saying "Oh, I guess you are right, that is the only way to do that, just because my all-know friend said it is so" freak. Sorry just had to say that.) Well once basically you gain general knowlege you can ask community for help, we won't refuse! Happy hacking to you, Pavel -- Bask in the glow of the digital silence http://www.vancouver.yi.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] HTTP::GHTTP
On Tue, 21 Nov 2000, Matt Sergeant wrote: This is a bit off topic as its not specifically mod_perl, but I wrote it for use in a mod_perl environment, so I figure it will be useful to other people. HTTP::GHTTP is a lightweight HTTP client library based on the gnome libghttp library. It offers a pretty simple to use API for doing HTTP requests. This can be useful under mod_perl because the alternatives (e.g. LWP) are quite large. Example usage: # short get() method use HTTP::GHTTP 'get'; print get("http://axkit.org/"); # longer OO usage my $r = HTTP::GHTTP-new(); $r-set_uri("http://xml.com"); $r-process_request; print $r-get_body; Supports proxies and authentication too. Heading to CPAN now. Excellent! =) Pavel -- Bask in the glow of the digital silence http://www.vancouver.yi.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache::Registry vs. Handlers
On Sun, 19 Nov 2000, E.S. wrote: All other things being equal, what's the general performance difference between writing your own handlers or using a templating system vs. using your scripts under Apache::Registry? I've been running my old CGI scripts under Apache::Registry for awhile now, and they seem to be pretty speedy; what do I have to gain by doing it the "right" way? Depends on implementation, and benchmarks, benchmarks... and benchmarks. Tightly coded modules would be the fastest, and do them in perl perhaps slowly translating them into C if you really want the performance. However, flexibility here is last item on the list. Templating system - written a few and all different, some real fast, nearly as fast as custom modules others about 2 - 5 time slower, because they are so flexible. Apache::Registry - use it only for backend or lowtraffic sites. It does not cache anything, so when you do databases, and files, can be bad to horrible to use. Using with small MySQL databases (50,000 records) you can get mediocre performance, cuz mysql connects require virtually no setup overhead. So if basically you have bunch of old code you have to throw up on the web and have no time this is the way to go. So there, Pavel -- Bask in the glow of the digital silence. http://www.vancouver.yi.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: learning for someone like me
Ok, run to a book store NOW, and get O'Rielly's Eagle Book! Read it from core to the core and then post questions here, once you are done. Good luck, Pavel look @ http://perl.apache.org/guide - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Another *new* idea patented
On Sat, 18 Nov 2000, Bill Moseley wrote: I know this is way off topic, but I couldn't resist. Sorry if this is old news. First Amazon figures out that cookies could be used for, (who would have guessed?), maintaining state between sessions and patenting the concept. What a new idea! Now looking at eBay and I see that they have invented this thing called "thumbnails" that are miniature photos that you can, get this, click with your mouse! Not only that, they have figured out a way to transfer images from one computer to another via HTTP! Another brilliant invention that needs a patent. http://pages.ebay.com/help/basics/g-gallery.html "Gallery Our patent pending Gallery () is a new way of browsing items for sale at eBay. The Gallery presents miniature pictures, called thumbnails, for all of the items sellers have supplied pictures for in JPG format." NEVER UNDERESTIMATE POWER OF A LARGE GROUP OF STUPID PEOPLE. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: compiling modperl on alpha
On Fri, 17 Nov 2000, Jimi Thompson wrote: Try getting rid of Perl 5.6 and using 5.005. This has worked for me and for several other folks running other flavors of Unix. Weird, but compiled 5.6 perl with default options does not mesh well with mod_perl, however I run Mandrake Linux, and 5.6 precompiled for this platform, seem to integrate into mod_perl somewhat seamlessly. I suppose if you want 5.6 with mod_perl you gotta ask Mandrake folks for compile time options. just 2c Pavel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: database access
On Tue, 14 Nov 2000, Les Mikesell wrote: I wonder if Apache::DBI could figure out what connections are worth holding open by itself? It could have some hints in the config file like regexps to match plus a setting that would tell it not to make a connection persist unless it had seen x instances of that connect string in y seconds. That really, really sucks, but Apache is selecting on the HTTP socket, and nothing matters beyond that, except signals of course. What you are implying is that DBI will be aware of the connections being closed or SIGALRM coming thru to the apache and on its lap, but it won't happen. Here you have to decide wether you will keep the connection or not, and if it something happens, like closing, you have to wait until user hits the page. Yes you can make ModPerl timestamp DBI links, so that they can be timed out next time a user calls one of the DBI functions, maybe connect? But asynchrosity is out of the question. It would be cool however if you can insert your socket into apaches select queue... isn't that how it works? Then you can really do some funky stuff... just 2c Pavel
Re: Microperl
On Thu, 16 Nov 2000, Robin Berjon wrote: I know what you mean but this is MicroPerl, not Perl. I don't know how much difference it makes, but it's certainly smaller. I'm afraid I can't help with embedding it though. I like the idea, not just for rewrites (I'm quite happy with mod_rewrite most of the time) but for all the conf stuff. It doesn't have dynaloader, but you could still do things like read conf from a flat file db or that sort of thing. Hacking down the size of the code is good, but now when it comes down to hacking down features, and features must go if you are to shrink perl. Ok so the fullsize language is a ~350 K addon to apache, for that we get all the good stuff like superoptimising compiler, that is very smart about figuring out 'smart' code. If you really want to go that way, PHP4 probably one of the better shots you have. Besides PHP was vowed to be an improved language over the perl for the web development, and to degree it is if you just want to hack together a small database enabled comments book. However me knowing perl is advantage over PHP, because horsepower is cheap, disk troughput will always faster than that of a network speed, modularity and superflexibility of the perl will always will be irreplacable. MicroPerl is akin to what PHP zealots used to tout PHP as, and yes perl can be awkward to read at times, but thats why it is good, there is breathing space wasted to let coder's brain sort of relax, like long function calls for invoking Regular Expressions on the string vs =~. PHP in some ways is faster than perl, but hey, I do not compare Saleen Mustang to a Lamborgini Diablo. Hope you will make the right choice for yourself, not us ;-) Pavel
Re: [OT] mod_perl evangelism
On Tue, 14 Nov 2000, Greg Cope wrote: Agreed. I've always thought that php had better "web support" in terms of "How to do this in php" or tutorials. mod_perl's lack of similar resources is not a bad thing. Stas was up to something similar with sourcegarden - do not know where thats upto - I think Stas has been buzy with other things. I'd help with something (sticking his head out on a block ;-) Having such tutorials will bring more crowds to mod_perl commutity. Doing so,(Shovel method) will scoop alot of unintelligent people who will be posting idiotic questions to this list. So far I have see few and been pleasently surprised! =)
Re: Modperl conflicting with other modules
On Mon, 13 Nov 2000, Yu Di wrote: Hi, the problem is, when I compile Mod_perl and PHP both as static with Apache, none of them can work. And what's worse, when they are both static, I can't access any HTML pages either, the error log is just the same as described in my former mail. What is the problem here? I forgot to mention that my Perl version is 5.6.0, can this be related to the problem? Well, that might be the problem, sysadmins at our workplace tried to compile mod_perl with Perl5.6 default compiliation options, and it crapped all over the place. I however use Mandrake built perl, and it seems to work file for installing mod_perl. However if you do like to have both items on the list, you might consider making two apaches, whichever is less accessed, place it on some port like 8000 or 8080... and then compile the primary server with mod_proxy. Then place ProxyPass I think it is called, to the the secondary server for related URLs, or RegExp. Everytime people visit those urls primary apache will open local connection to secondary one, and do the processing there, and return results... Good luck, Pavel
Re: Passing data structures between Stacked Handlers
On Sun, 12 Nov 2000, Dave Kaufman wrote: Is there a module that can do "Stacked Handler Pipelining", but doesn't pass around tied filehandles but data structures ? Can't you allocate some generic namespace, or better yet, create your own package called config and in that export functions get_config set_config They will get/set a package wide variable. Then you make new,DESTROY, and what other functions you need. Then you create/set object in the Init module and the way you go, call get_config in each of the stacked modules and insert data into it, so it will be passed along. Simple alternative, you can store a hash in package wide namespace of the first package, and access that via hashref, which is more convinient or Package::hashname notation. Thats how I did it. If there isn't, could it be implemented by dumping the data structure to $r-notes (with Data::Dumper) and have it eval'ed back by the next handler? God NO! Have you read of overhead incurring on eval? Might as well go back to the days of PerlCGI,choke, choke Hope that helped. Pavel
premature TCP termination
Hi, I wonder if there is some sort of notification my module can receive if the user has terminated HTTP transaction(ie dowloading of a search result), by closing TCP link, or the Apache's connection has timed out... URLs, pointers would be excellent. Thanks, Pavel