From parihartarun at sify.com Sat Nov 7 03:45:58 2009 From: parihartarun at sify.com (tarun parihar) Date: Sat, 7 Nov 2009 14:15:58 +0530 Subject: [FASTCGI] How to integrate JSP and FastCGI Message-ID: <9c34caf0911070045y6f47d70dm3e7ad9638b730f39@mail.gmail.com> Hi All, I need to develop a web system which involve scientific computation with lot of data. And need to do present the computed result using graphs. Scientific computation code is developed using C++ Initially I tried using CGI library for executing and getting results. And JSP for presenting computed result. (as java has rich and easy support for that) But it takes lot of time to respond as computation is complex. The computation can be devided in to parts- 1. Commen compution to initialise and populate huse datastructures. (takes more time) 2. Request specific computation using already populated datastructures. (takes less time) I am thinking to use FastCGI for this such that first part of the computation is done when FastCGI process starts and when user give a request, second part of the computation will be done. And hence he will get a faster response. I have no idea how to make it work. I am stuck here. Can anybody guide me how I should proceed? Your help will be most appreciated. Regards, Parihartarun -------------- next part -------------- An HTML attachment was scrubbed... URL: From sxk1969 at hotmail.com Sat Nov 7 10:56:09 2009 From: sxk1969 at hotmail.com (Saikat Kanjilal) Date: Sat, 7 Nov 2009 07:56:09 -0800 Subject: [FASTCGI] How to integrate JSP and FastCGI In-Reply-To: <9c34caf0911070045y6f47d70dm3e7ad9638b730f39@mail.gmail.com> References: <9c34caf0911070045y6f47d70dm3e7ad9638b730f39@mail.gmail.com> Message-ID: Hi Tarun: Using cgi for this will be difficult since cgi creates and unloads a process for each and every request which in your case are computation intensive. Having built this exact architecture in the past, your design roughly should have two parts, you can have what is known as a front end piece that sits there and accepts requests and puts those requests into a queue (hopefully an in memory queue but can also be done with job files). Your backend will comprise of your computation intensive components only and will run in daemon mode in unix waking up every so often to process jobs in the queue. In the java world you can use a servlet to take in the request and hand that off to a background thread that does the computation intensive processing using webservices with fastcgi to the c++ components. The background thread will need to keep track of the computation and update the jsp page containing the graphs through automated mechanisms . Note that you will need to keep the MVC architecture in mind and have a middle tier facade object that interacts with the jsp page but also with the c++ components and acts as the controller for message passing between the two entities. As far as dividing up the computation you can have two components that both run in daemon mode and wake up and respond to requests in the job queue. The other option is to have a java client piece that uses a shared memory data structure such as a named pipe to talk to the c++ components which now act as consumers of requests, this is a bit more complicated but is still doable. Let me know if you need more help. Regards Date: Sat, 7 Nov 2009 14:15:58 +0530 From: parihartarun at sify.com To: fastcgi-developers at mailman.fastcgi.com Subject: [FASTCGI] How to integrate JSP and FastCGI Hi All, I need to develop a web system which involve scientific computation with lot of data. And need to do present the computed result using graphs. Scientific computation code is developed using C++ Initially I tried using CGI library for executing and getting results. And JSP for presenting computed result. (as java has rich and easy support for that) But it takes lot of time to respond as computation is complex. The computation can be devided in to parts- 1. Commen compution to initialise and populate huse datastructures. (takes more time) 2. Request specific computation using already populated datastructures. (takes less time) I am thinking to use FastCGI for this such that first part of the computation is done when FastCGI process starts and when user give a request, second part of the computation will be done. And hence he will get a faster response. I have no idea how to make it work. I am stuck here. Can anybody guide me how I should proceed? Your help will be most appreciated. Regards, Parihartarun _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141665/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From fastcgi-developers at wilber.pointclark.net Sun Nov 8 04:25:21 2009 From: fastcgi-developers at wilber.pointclark.net (Matt) Date: Sun, 8 Nov 2009 20:25:21 +1100 Subject: [FASTCGI] How to integrate JSP and FastCGI References: <9c34caf0911070045y6f47d70dm3e7ad9638b730f39@mail.gmail.com> Message-ID: <00f201ca6055$65b6b5c0$e701a8c0@cu> Have a look at "echo-cpp.cpp" which is located in the examples directory. You can do your first part of the computation in the: int main (void) body and the second part of the computation in this loop: while (FCGX_Accept_r(&request) == 0) ----- Original Message ----- From: tarun parihar To: fastcgi-developers at mailman.fastcgi.com Sent: Saturday, November 07, 2009 7:45 PM Subject: [FASTCGI] How to integrate JSP and FastCGI Hi All, I need to develop a web system which involve scientific computation with lot of data. And need to do present the computed result using graphs. Scientific computation code is developed using C++ Initially I tried using CGI library for executing and getting results. And JSP for presenting computed result. (as java has rich and easy support for that) But it takes lot of time to respond as computation is complex. The computation can be devided in to parts- 1. Commen compution to initialise and populate huse datastructures. (takes more time) 2. Request specific computation using already populated datastructures. (takes less time) I am thinking to use FastCGI for this such that first part of the computation is done when FastCGI process starts and when user give a request, second part of the computation will be done. And hence he will get a faster response. I have no idea how to make it work. I am stuck here. Can anybody guide me how I should proceed? Your help will be most appreciated. Regards, Parihartarun ------------------------------------------------------------------------------ _______________________________________________ FastCGI-developers mailing list FastCGI-developers at mailman.fastcgi.com http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmoati at jmoati.net Tue Nov 17 04:58:33 2009 From: jmoati at jmoati.net (Jacques Moati) Date: Tue, 17 Nov 2009 10:58:33 +0100 Subject: [FASTCGI] Compilation failed Message-ID: Hello, First : As far as I am concerned, it's miss a #include into the fcgio.cpp Error : 'EOF' was not declared in this scope ------------------------------ ------------------------------------------------------------------------ Second : When I compile with .configure and make, no problem. But, when I compile with code::blocks IDE, I have an new error : os_unix.c|319|warning: implicit declaration of function ?gethostbyname?| os_unix.c|319|warning: initialization makes pointer from integer without a cast| os_unix.c|322|error: dereferencing pointer to incomplete type| I am under Ubuntu 9.10 with gcc version 4.4.1. Any idea ? Thanks and sorry for my bad english. Jacques. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bug.png Type: image/png Size: 94999 bytes Desc: not available URL: From michiel.beijen at otrs.com Wed Nov 18 10:41:12 2009 From: michiel.beijen at otrs.com (Michiel Beijen) Date: Wed, 18 Nov 2009 16:41:12 +0100 Subject: [FASTCGI] perl and FastCGI Message-ID: <4B041598.5070005@otrs.com> Hi guys, Let me start by saying that I really like it that there seems to be activity on the FastCGI front. That's great! I'm trying to use FastCGI (the latest SNAP release) with Strawberry Perl 5.10.1 and Apache 2.2.x on Windows. I find it a little difficult to troubleshoot FastCGI, am I missing something? When I try to access my FastCGI script the Apache log says: [Wed Nov 18 16:31:41 2009] [notice] Parent: child process exited with status 255 -- Restarting. But when I run the script from the command line I get this: C:\inetpub\wwwroot\myapp>perl installer.fpl Content-Type: text/html; charset=utf-8; Content-Disposition: filename="Installer.html" Expires: Tue, 1 Jan 1980 12:00:00 GMT Cache-Control: no-cache Pragma: no-cache ... So what should I do to find out why it returns status 255, and what's wrong with that? Regards, -- Mike. From michiel.beijen at otrs.com Thu Nov 19 08:21:14 2009 From: michiel.beijen at otrs.com (Michiel Beijen) Date: Thu, 19 Nov 2009 14:21:14 +0100 Subject: [FASTCGI] perl and FastCGI In-Reply-To: <4B041598.5070005@otrs.com> References: <4B041598.5070005@otrs.com> Message-ID: <4B05464A.8050706@otrs.com> I wrote: > When I try to access my FastCGI script the Apache log says: > [Wed Nov 18 16:31:41 2009] [notice] Parent: child process exited with > status 255 -- Restarting. > > But when I run the script from the command line I get this: > > C:\inetpub\wwwroot\myapp>perl installer.fpl > Content-Type: text/html; charset=utf-8; > ..... Just to be complete: i found out what the issue was; the shebang-line, which is not needed by Perl when you invoke a script from the command line with 'perl.exe myscript.pl', but IS used by fastcgi, was wrong... Hope this might help someone trying to enjoy the speed of FastCGI + Apache.... -- Mike. From hoshino at labs.cybozu.co.jp Tue Nov 24 23:57:34 2009 From: hoshino at labs.cybozu.co.jp (=?iso-2022-jp?B?IhskQkAxTG4bKEIgGyRCNiwbKEIi?=) Date: Wed, 25 Nov 2009 13:57:34 +0900 Subject: [FASTCGI] [PATCH] support WIN64 with several fixes. Message-ID: <125912505451300001034@WINSERVER> Hello, I posted x64 patch for 2.4.0 several months ago and now recreated it for current snapshot (2.4.1-SNAP-0910052249). For convinience, it consists five files attached to thie email. Each patch description: 1-align-x64.patch * Fixed functions to support both 32/64 bit build. AlignInt8(), AlignPtr8(). This modification is essential for Windows 64bit build. 2-socklen.patch * Fixed socklen_t detection failure problem in configure script for Linux. 3-gcc44.patch * Fixed for gcc-4.4 build on Linux. 4-vc9.patch * Converted Win32/*.{dsw,dsp} files to Win32/*.{sln,vcproj} files (Visual Studio 2008 solution/project files) and added platform "x64" for 64bit build. * Removed almost all build warnings on Visual Studio 2008. with PreprocessorDefinitions: _CRT_SECURE_NO_WARNINGS and _SCL_SECURE_NO_WARNINGS. 5-build-warnings.patch * Fixed type size problem (pointer, size_t, etc.) to support both 32/64 bit build using intptr_t, uintptr_t, etc. * Fixed to check range of each numeric variable with ASSERT() before using type cast for demotion(narrowing). * Replaced several standard functions to recommended ones. getpid() --> _getpid(), and so on. * Removed almost all build warnings on Linux. Current status: * Tested the patches on Windows Server 2008 SP1 (64bit). with apache httpd 2.2.14 (32bit) and mod_fastcgi-SNAP-0910052141. Both 32/64 bit sample executables are working. We could not build and test two samples: threaded and log-dump. * Tested the patches on CentOS 5.4 (64bit) with gcc-4.3.4. For 32bit build, we used gcc -m32 option. Both 32/64 bit sample executables are working except log-dump. We could not find out the usage of log-dump so that we could not test it. How to build: 1. For Windows 1-1. Extract fastcgi-2.4.1-SNAP-0910052249.tar.gz. > tar xzf fastcgi-2.4.1-SNAP-0910052249.tar.gz 1-2. Apply patch files. > cd fastcgi-2.4.1-SNAP-0910052249 > patch -p1 < ../1-align-x64.patch > patch -p1 < ../2-socklen.patch > patch -p1 < ../3-gcc44.patch > patch -p1 < ../4-vc9.patch > patch -p1 < ../5-build-warnings.patch 1-3. Open fastcgi-2.4.0/Win32/FastCGI.sln with Visual Studio 2008 and build. Debug and Release build on Win32 and x64 are supported. Build with 'nmake' is not supported, since we could not find out suitable project converter and we can use 'devenv' command line instead. 2. For Linux 2-1. Do the same process as (1-1). 2-2. Do the same process as (1-2). 2-3. Remake configure script. > libtoolize -c -f > aclocal > autoheader > automake -a -c -f > autoconf 2-4. Configure and make > ./configure > make > make install If you need, NDEBUG preprocessor definition should be specified to eliminate ASSERT check for release build. Sincerely, Hoshino --- HOSHINO Takashi Cybozu Labs, Inc. -------------- next part -------------- A non-text attachment was scrubbed... Name: 1-align-x64.patch Type: application/octet-stream Size: 1036 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2-socklen.patch Type: application/octet-stream Size: 692 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3-gcc44.patch Type: application/octet-stream Size: 258 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4-vc9.patch Type: application/octet-stream Size: 129953 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 5-build-warnings.patch Type: application/octet-stream Size: 38000 bytes Desc: not available URL: