From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Knoop Sent: 27 November 2007 10:36 To: activeperl@listserv.ActiveState.com Subject: Best architecture for CGI scripts accessing dbm file
> Hi > > I have a CGI script which among other things ties to a dbm file in order to do look ups on certain CGI > parameters. Performance is ok but I wonder whether it is efficient for each call to the script to open a tie to > what is essentially the same data and whether it will suffer under load. > > I tried to find out more about how tie works but it is not clear to me whether or not it loads the whole dbm > into memory. If it does then I would like to assess other ways of doing this. > > I suspect implementing mod_perl or ISAPI when I have not used them in much before is too much work and unknowns > for this urgent critical task (though if this sounds wrong let me know!) > > So my question is whether there is a another way of sharing this data between many CGI calls which is as fast > and light on memory as possible. > > One idea I had was to set up a SOAP or XML RPC server which has the tied dbm and responds to calls from the CGI > scripts with the specific info required for each one. A round the houses way of doing it perhaps but one that I > can get my head around (and give me a chance to play with writing a SOAP or XML RPC server). > > But I thought I would run it past you in case you could point out any obvious things I had missed or had your > own ideas about an elegant solution to this. > > Or should I really look at mod_perl/ISAPI, CGI::Application or something else? > > Or is it fine to keep doing it the way I am? > > I do intend to try some benchmarking but some pointers as to which options are worth focusing on would be a > huge help. Avoid premature optimisation. Do your benchmarking against your expected load to see if you actually have a problem before trying to solve it. If its not fast enough, then profile to locate where the bottleneck(s). If, for example, your shared resource (i.e. dbm file) turns out to be a bottleneck because access to it has to be serialised, then it unlikely that any of the above ideas will help very much. Remember, the first rule of optimisation is don't do it yet. :-) HTH -- Brian Raven ========================================= Atos Euronext Market Solutions Disclaimer ========================================= The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions. Atos Euronext Market Solutions Limited - Registered in England & Wales with registration no. 3962327. Registered office address at 25 Bank Street London E14 5NQ United Kingdom. Atos Euronext Market Solutions SAS - Registered in France with registration no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 75009 Paris France. L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions. Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank Street E14 5NQ Londres Royaume Uni. Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France. ========================================= _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs