Thanks everyone, development tells me that their going to build the function into the application. trying to build custom kernels and then using a tcp_keepalive would be a logistic nightmare.
Cheers, Matt On Fri, Mar 28, 2014 at 12:53 AM, Christopher Schultz < ch...@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Mark, > > On 3/27/14, 5:38 AM, Mark Thomas wrote: > > On 27/03/2014 03:08, Matthew Turany wrote: > >> Is it possible to configure either apache or tomcat to send a > >> packet every x number of seconds so that at the client end the > >> gateway thinks the session is still active and will keep the > >> connection open, or is this something best put into the actual > >> web app? > > > > http://tomcat.apache.org/connectors-doc/reference/workers.html > > socket_keepalive > > > > You'll need to configure the OS to send the packets frequently > > enough. > > > > Alternatively, change the application design: - One request to > > trigger generation of the report - N requests to retrieve report > > which returns either "still processing" (maybe with an ETA) or > > "here it is". > > +1 > > I believe this is a better design in the long-run. It also allows you > to do things like off-line processing of batches without changing your UI. > > Another thing you could do is simulate the above by using a > report-builder thread launched from your servlet, and then have your > request-processing thread to a flush() on the response (causing > chunked encoding to be used), then sleep for some amount of time > (maybe 1-5 seconds), then check the status of the report, then flush() > again (not sure if it will keep emitting 0-length chunks if you flush > over and over again), then sleep again. > > This seems like a perfect use case for async processing. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQIcBAEBCAAGBQJTNFd6AAoJEBzwKT+lPKRYANwP/Rx3W5KQQnLzMx/xEY41cix0 > JuAEGxZVQyX5LDwLlB5iivIAGdVqLZxXGP/4on/sIgl+XjC59hkU4N77oLokb3Cl > heAgUmR9VA4KsUTMeSJmN0Km5lMOzCv3c+Ru5fAjSpsNKgp2SjsitpdGgRfebd1y > djQfemWIkC6bBHjtW4PbwGkva9Kny8FVx2Ius8f6V+jKcHGLGztWIfy99rR0Oya3 > 2dP/JboBPH0PYW19Jhor7qM7IMJXJjdRSswnBc63e7runvw8hA1DD3KDW0mHceVo > Q4Q0WW1zRaT1DOzkmQhOs4H68ev20EjV9DZu8Md17kJVrwkeFMN+GGNppLeivzdK > UZHkEWbZjDZRcIGR0iEQQZGLVCRMImNsm+fBoO6piXrr8UFpzMUqXLMiSuD3Woab > GFtvydUBuO4gyxAHXh2yW+XJ1iZBSfigUBvTZUKOyS1sEURBKmgTopySuJaKPhYN > OMYCQ8e5MKbcxl09qp7JRg+H/jfIr9NBgakWrQRe4R1Pox1doMaNZsJufwpkbxH2 > 0CKNuLClIrvQC/iw5D7McB0o5PY5brOMGzWfdb6Psgnrq/4FB3QDdSCbIaQ8JF+E > GfRZ5D2VE73ueb8dYiElA0t3fEV0DSdqOtxR40IwROlpR6My7HBUVgy/7dxkxEg7 > xXj/B0T5nbShYxZrlw3S > =RtBD > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >