[FASTCGI] How to integrate JSP and FastCGI

Saikat Kanjilal sxk1969 at hotmail.com
Sat Nov 7 10:56:09 EST 2009


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: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20091107/20b0ed5a/attachment.html>


More information about the FastCGI-developers mailing list