New topic: RB WEb on Windows 7 64bit with apache - need help tuning it
<http://forums.realsoftware.com/viewtopic.php?t=41303> Page 1 of 1 [ 3 posts ] Previous topic | Next topic AuthorMessagedamon Post subject: RB WEb on Windows 7 64bit with apache - need help tuning itPosted: Fri Nov 04, 2011 3:24 am Joined: Mon Oct 17, 2005 6:43 pm Posts: 96 Hi Guys, I am running my WE app on Apache (which I host) and it runs fine however I would like to tune a few things and I hope someone might be able to solve my problems. My system is Windows 7 (64 bit) assume a high end system - 8GB Ram/4TB hard drive etc... Apache (latest release) installed my XAMPP PEAR, CGI and PEARL (latest release) installed by XAMPP MySQL (latest release) - 64 bit install on separate server I have no problems with permissions as I host everything and as such I just drag and drop. I have set up the CGI-BIN to be a new folder which contains only my WE app and the other folders and files.I have changed the *.cgi to the correct PERL path and it all runs well I hope I just need to fine tune a few things. Question 1 I have built into the start page a timer which checks if the user has done anything for the past 3 minutes and if they have it resets a timer, if they haven't and haven't done anything for 30 minutes it will disconnect them. Which works well If they are on another page ( there are over 100 ) and they don't do anything for about 5-10 minutes it will disconnect them. I am about 60% sure it isn't MySQL but cannot locate the TIMEOUT for this. Can anyone direct me to the TIMEOUT values for Apache, MySQL, PEAR, CGI and/or Pearl. Question 2 Does Apache run the CGI app for each user? From what I can tell it runs the app once and then keeps forwarding the users to the same app. This to me is silly as a multi-core machine should have the one app running multiple times to utilize the cores. I have seen the app taking 2.3 GB of ram and only running once so I assume this to be the case however is there a way to make Apache change this? I notice that the app only appears in the task manager once it gets to about 2GB prior to that it doesn't appear in the task manager ( process's list ) at all. 2a Is there anyway to limit the number of connections that the WE app will accept before it "tells" Apache it has has enough load and to launch it again? Question 3 Memory usage - as part of the above I would think that once all users have logged off , Apache would close the app and free up the memory. This does not seem to be the case, it just keeps it open and consumes more memory. Is there anyway to get Apache to re-launch the app once there is no connection to the app. I also find that "something" gives up at about 3GB and it just shuts the app down giving the "the * has started but unable to run on port XXXXX" to any user which tries to access the page. Question 4 Any hints to optimizing Apache for WE only applications. I don't use it to run anything else except the app.cgi . Question 5 This one really annoys me. When I ran it as a RB stand alone all I had to do to update the app was to close it and then replace the old app with the new app and run it again. With Apache I have to close the Apache server and then reboot the machine, replace the old app with the new app and then run Apache again. Is there anyway to just close something and replace the app? I have a big system (8 cores) just for Apache and it should be a bit more reliable. The system seems to shut down if 7 users are on at the same time OR if the total users for the day is about 30-40. Both of which happen about 4 times a day. I guess I have something wrong as I have run Apache for years (on my own servers) and they have never had a problem, a timeout or had memory usage over about 20% on a 2GB RAM machine. If you want to have a look it is at http://www.TheEDiCloud.com PS - I cannot run Apache as a service as it will use the USA date format if anyone else knows why this might happen please tell me. It runs fine if I START/STOP Apache. Any and all comments, recommendations or tips will be very much appreciated. Thanks Damon Top andrekui Post subject: Re: RB WEb on Windows 7 64bit with apache - need help tuningPosted: Fri Nov 04, 2011 5:13 am Joined: Sat Mar 25, 2006 7:29 am Posts: 93 Hi Damon, 1)Apache has also timers that keep track of activity of the connection, These i have in my httpd.conf: KeepAlive on KeepAliveTimeout 300 TimeOut 300 If you use fastCGI then the following commands in the config may help: FcgidIOTimeout 64 FcgidConnectTimeout 16 FcgidMaxRequestsPerProcess 500 In my configuration Apache doesn't stop the app as long as there is still a connection and after the last connection stops, the app keeps running for 300 seconds. If within that timeframe a new connection starts, the app is immediately active. 2)The cgi file is the middleman, it starts the app and exchanges information between the app and the connected user/browser. The cgi-file is a perl-script and to execute it needs to start Perl.exe and for exchanging info and commands it needs a kind of a host. So every connection needs an active Perl.exe svchost.exe (AFAIK this one lives only as long as it takes to execute commands and exchange info between app and client/browser) and the app.exe 2a)AFAIK that is not an option for CGI-apps, but it exists for FastCGI, see the FcgidMaxRequestsPerProcess 500 setting. 3) Apache standard has a timeout of 300 seconds, after that the memory should be released, why it isn't in your case i don't know. The 3 GB is probably the memory limit for 32-bit applications, if any of the used components is 32 bit, that will dictate the limits. 4) The only thing i can think of is use FastCGI, you only have to change the extension of the CGI-file in fcgi and have the settings in Apache httpd.conf file set to use FastCGI or FCGID. 5) I don't have this problem, if you want to replace the app, make sure there aren't any active connections, then go to the taskmanager and in the tasklist select the app that you want to replace. Then click on that app in the tasklist with the right mousebutton and select in the menu to end the process-STRUCTURE and not only the process. In this way not only the app will shutdown but also the perl.exe and svghost.exe that belong to that app and then it should be possible to replace the app in the CGI-bin directory. This is what i discovered mainly by trial and error, but i am not 100% sure everything is correct so just try on your own risk. Nevertheless i hope this helps a bit. Kind regards, Andre Top damon Post subject: Re: RB WEb on Windows 7 64bit with apache - need help tuningPosted: Fri Nov 04, 2011 5:29 am Joined: Mon Oct 17, 2005 6:43 pm Posts: 96 Hi Andre, many thanks , I haven't read it all yet but wanted to say thank you before you went to bed or work. very much appreciated Damon Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
