[Geoserver-users] Session timeout for GeoServer

So what you're saying is that if a single request takes longer than 10
seconds you just want GeoServer to not return anything?

Not exactly. My main purpose is to prevent the number of sessions from
exploding. Is it possible for me to maintain just one session for multiple
requests to GeoServer through the use of cookies?

I think I should be taking back what I said. I realize it's not possible for
me to do it through the use of cookies for my app. But I still want to
maintain just one session for multiple requests to GeoServer.

Note that if you break the client connection pipe then GeoServer is
smart enough to stop that connection. So that could be one way to go
about it, just make sure the client closes their connection. That will
probably stop it as quickly as anything you could hack in to GeoServer,
since that hack would use the exact same mechanism to stop.

But the session will still be around till it is killed after idling for some
time. My concern is that these sessions grow very fast (saw the number
exploding in Tomcat manager) and holds onto resources even after its
connection is stopped. Thus the reason why I want to set the session timeout
for these sessions.

Would really appreciate some guidance on this. Thanks.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

-----Original Message-----
From: Lee Wai See [mailto:leewse@anonymised.com]
Sent: Friday, July 28, 2006 11:17 AM
To: 'Chris Holmes'
Cc: 'geoserver-users@lists.sourceforge.net'
Subject: RE: [Geoserver-users] Session timeout for GeoServer

So what you're saying is that if a single request takes longer than 10
seconds you just want GeoServer to not return anything?

Not exactly. My main purpose is to prevent the number of sessions from
exploding. Is it possible for me to maintain just one session for multiple
requests to GeoServer through the use of cookies?

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

-----Original Message-----
From: geoserver-users-bounces@lists.sourceforge.net
[mailto:geoserver-users-bounces@lists.sourceforge.net] On Behalf Of Chris
Holmes
Sent: Thursday, July 27, 2006 10:42 PM
To: Lee Wai See
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Session timeout for GeoServer

Lee Wai See wrote:

Hi Chris,

What I understand is that whenever a request is sent to GeoServer, there

will be a new session created for GeoServer. How can I set the timeout
for these sessions?

You may also consider setting it in your servlet container, that may be
the cleaner way to do it? Note that I think your use of 'session' isn't
quite the way it's generally used, a session is like when you're
navigating a series of web pages, as you're logged in. You seem to be
wanting a timeout for a single response? Or am I reading what you wrote
wrong?

You got me right. The reason why I want to do this is that my application
sends requests to GeoServer very frequently where the time between two
requests is 10secs. So the sessions created for each request would build

up

very fast. Is there some workaround for this?

So what you're saying is that if a single request takes longer than 10
seconds you just want GeoServer to not return anything?

Note that if you break the client connection pipe then GeoServer is
smart enough to stop that connection. So that could be one way to go
about it, just make sure the client closes their connection. That will
probably stop it as quickly as anything you could hack in to GeoServer,
since that hack would use the exact same mechanism to stop.

best regards,

Chris

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: Thursday, July 27, 2006 4:17 AM
To: Lee Wai See
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Session timeout for GeoServer

Lee Wai See wrote:

Hi,

Is there any way to set session timeout for GeoServer?

No, not currently. Probably would not be too hard to implement.

What I understand is that whenever a request is sent to GeoServer, there
will be a new session created for GeoServer. How can I set the timeout
for these sessions?

You may also consider setting it in your servlet container, that may be
the cleaner way to do it? Note that I think your use of 'session' isn't
quite the way it's generally used, a session is like when you're
navigating a series of web pages, as you're logged in. You seem to be
wanting a timeout for a single response? Or am I reading what you wrote
wrong?

Chris

Would greatly appreciate some guidance on this. Thanks a lot.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the

message

from your system; please do not copy or use it for any purpose, nor

disclose

its contents to any other person. Thank you.]
---ST Electronics Group---

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share

your

opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

!DSPAM:1003,44c77362316678365517736!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,44c77362316678365517736!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Lee,

The only solution I can see if you can’t support cookies is to set a very short session timeout as you mentioned up front. You can change the session timeout by editing the web.xml file found in the WEB-INF directory for geoserver. You specify it like this:

<web-app>
  <session-config>
    <session-timeout>60</session-timeout>
  </session-config>
...
</web-app>

The units are minutes so the shortest timeout possible would be 1 minute.

That said, I think a bug should be filed because as far as I can tell, both the WMS & WFS protocols are stateless so GeoServer shouldn’t be creating a session. (I’m not as familiar with WFS but WMS is definitely stateless).

Corey

On 7/28/06, Lee Wai See <leewse@anonymised.com> wrote:

So what you’re saying is that if a single request takes longer than 10
seconds you just want GeoServer to not return anything?
Not exactly. My main purpose is to prevent the number of sessions from
exploding. Is it possible for me to maintain just one session for multiple
requests to GeoServer through the use of cookies?

I think I should be taking back what I said. I realize it’s not possible for
me to do it through the use of cookies for my app. But I still want to
maintain just one session for multiple requests to GeoServer.

Note that if you break the client connection pipe then GeoServer is
smart enough to stop that connection. So that could be one way to go
about it, just make sure the client closes their connection. That will
probably stop it as quickly as anything you could hack in to GeoServer,
since that hack would use the exact same mechanism to stop.

But the session will still be around till it is killed after idling for some
time. My concern is that these sessions grow very fast (saw the number
exploding in Tomcat manager) and holds onto resources even after its
connection is stopped. Thus the reason why I want to set the session timeout
for these sessions.

Would really appreciate some guidance on this. Thanks.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

-----Original Message-----
From: Lee Wai See [mailto:leewse@anonymised.com]
Sent: Friday, July 28, 2006 11:17 AM
To: ‘Chris Holmes’
Cc: ‘geoserver-users@lists.sourceforge.net
Subject: RE: [Geoserver-users] Session timeout for GeoServer

So what you’re saying is that if a single request takes longer than 10
seconds you just want GeoServer to not return anything?
Not exactly. My main purpose is to prevent the number of sessions from
exploding. Is it possible for me to maintain just one session for multiple
requests to GeoServer through the use of cookies?

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

-----Original Message-----
From: geoserver-users-bounces@lists.sourceforge.net
[mailto:geoserver-users-bounces@lists.sourceforge.net] On Behalf Of Chris
Holmes
Sent: Thursday, July 27, 2006 10:42 PM
To: Lee Wai See
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Session timeout for GeoServer

Lee Wai See wrote:

Hi Chris,

What I understand is that whenever a request is sent to GeoServer, there

will be a new session created for GeoServer. How can I set the timeout
for these sessions?
You may also consider setting it in your servlet container, that may be
the cleaner way to do it? Note that I think your use of ‘session’ isn’t
quite the way it’s generally used, a session is like when you’re
navigating a series of web pages, as you’re logged in. You seem to be
wanting a timeout for a single response? Or am I reading what you wrote
wrong?

You got me right. The reason why I want to do this is that my application
sends requests to GeoServer very frequently where the time between two
requests is 10secs. So the sessions created for each request would build
up
very fast. Is there some workaround for this?
So what you’re saying is that if a single request takes longer than 10
seconds you just want GeoServer to not return anything?

Note that if you break the client connection pipe then GeoServer is
smart enough to stop that connection. So that could be one way to go
about it, just make sure the client closes their connection. That will
probably stop it as quickly as anything you could hack in to GeoServer,
since that hack would use the exact same mechanism to stop.

best regards,

Chris

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: Thursday, July 27, 2006 4:17 AM
To: Lee Wai See
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Session timeout for GeoServer

Lee Wai See wrote:

Hi,

Is there any way to set session timeout for GeoServer?
No, not currently. Probably would not be too hard to implement.

What I understand is that whenever a request is sent to GeoServer, there
will be a new session created for GeoServer. How can I set the timeout
for these sessions?
You may also consider setting it in your servlet container, that may be
the cleaner way to do it? Note that I think your use of ‘session’ isn’t
quite the way it’s generally used, a session is like when you’re
navigating a series of web pages, as you’re logged in. You seem to be
wanting a timeout for a single response? Or am I reading what you wrote
wrong?

Chris

Would greatly appreciate some guidance on this. Thanks a lot.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the
message
from your system; please do not copy or use it for any purpose, nor
disclose
its contents to any other person. Thank you.]
—ST Electronics Group—



Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys – and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

!DSPAM:1003,44c77362316678365517736!



Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,44c77362316678365517736!


Chris Holmes
The Open Planning Project
http://topp.openplans.org


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys – and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Corey Puffalt wrote:

Lee,

The only solution I can see if you can't support cookies is to set a very short session timeout as you mentioned up front. You can change the session timeout by editing the web.xml file found in the WEB-INF directory for geoserver. You specify it like this:

<web-app>
  <session-config>
    <session-timeout>60</session-timeout>
  </session-config>
...
</web-app>

The units are minutes so the shortest timeout possible would be 1 minute.

That said, I think a bug should be filed because as far as I can tell, both the WMS & WFS protocols are stateless so GeoServer shouldn't be creating a session. (I'm not as familiar with WFS but WMS is definitely stateless).

Yeah, this is the issue for me, is that the protocols are inherently stateless. So what is the bug that needs to be filed?

> But the session will still be around till it is killed after idling
> for some
> time. My concern is that these sessions grow very fast (saw the number
> exploding in Tomcat manager) and holds onto resources even after its
> connection is stopped. Thus the reason why I want to set the session
> timeout
> for these sessions.
What resources does it hold on to? If it's not releasing resources then that's a problem. But I don't quite understand the number of sessions growing fast, when wms and wfs are stateless. Or do we just need to set a default of expiring sessions after a minute or so? A new session is created for every WMS/WFS call? I'm not sure what resources are being held on to though, as I'm pretty positive we release all the database connections and whatnot right away.

best regards,

Chris

Corey

On 7/28/06, *Lee Wai See* <leewse@anonymised.com <mailto:leewse@anonymised.com>> wrote:

     >> So what you're saying is that if a single request takes longer
    than 10
     >> seconds you just want GeoServer to not return anything?
     > Not exactly. My main purpose is to prevent the number of sessions
    from
     > exploding. Is it possible for me to maintain just one session for
    multiple
     > requests to GeoServer through the use of cookies?

    I think I should be taking back what I said. I realize it's not
    possible for
    me to do it through the use of cookies for my app. But I still want to
    maintain just one session for multiple requests to GeoServer.

     >> Note that if you break the client connection pipe then GeoServer is
     >> smart enough to stop that connection. So that could be one way
    to go
     >> about it, just make sure the client closes their
    connection. That will
     >> probably stop it as quickly as anything you could hack in to
    GeoServer,
     >> since that hack would use the exact same mechanism to stop.

    But the session will still be around till it is killed after idling
    for some
    time. My concern is that these sessions grow very fast (saw the number
    exploding in Tomcat manager) and holds onto resources even after its
    connection is stopped. Thus the reason why I want to set the session
    timeout
    for these sessions.

    Would really appreciate some guidance on this. Thanks.

    Regards,
    Lee Wai See
    ST Electronics (Info-Software Systems) Pte Ltd

    -----Original Message-----
    From: Lee Wai See [mailto:leewse@anonymised.com
    <mailto:leewse@anonymised.com>]
    Sent: Friday, July 28, 2006 11:17 AM
    To: 'Chris Holmes'
    Cc: 'geoserver-users@lists.sourceforge.net
    <mailto:geoserver-users@lists.sourceforge.net>'
    Subject: RE: [Geoserver-users] Session timeout for GeoServer

     > So what you're saying is that if a single request takes longer
    than 10
     > seconds you just want GeoServer to not return anything?
    Not exactly. My main purpose is to prevent the number of sessions from
    exploding. Is it possible for me to maintain just one session for
    multiple
    requests to GeoServer through the use of cookies?

    Regards,
    Lee Wai See
    ST Electronics (Info-Software Systems) Pte Ltd

    -----Original Message-----
    From: geoserver-users-bounces@lists.sourceforge.net
    <mailto:geoserver-users-bounces@lists.sourceforge.net>
    [mailto:geoserver-users-bounces@lists.sourceforge.net
    <mailto:geoserver-users-bounces@lists.sourceforge.net>] On Behalf Of
    Chris
    Holmes
    Sent: Thursday, July 27, 2006 10:42 PM
    To: Lee Wai See
    Cc: geoserver-users@lists.sourceforge.net
    <mailto:geoserver-users@lists.sourceforge.net>
    Subject: Re: [Geoserver-users] Session timeout for GeoServer

    Lee Wai See wrote:
     > Hi Chris,
     >
     >>> What I understand is that whenever a request is sent to
    GeoServer, there

     >>> will be a new session created for GeoServer. How can I set the
    timeout
     >>> for these sessions?
     >> You may also consider setting it in your servlet container, that
    may be
     >> the cleaner way to do it? Note that I think your use of
    'session' isn't
     >> quite the way it's generally used, a session is like when you're
     >> navigating a series of web pages, as you're logged in. You seem
    to be
     >> wanting a timeout for a single response? Or am I reading what
    you wrote
     >> wrong?
     >
     > You got me right. The reason why I want to do this is that my
    application
     > sends requests to GeoServer very frequently where the time
    between two
     > requests is 10secs. So the sessions created for each request
    would build
    up
     > very fast. Is there some workaround for this?
    So what you're saying is that if a single request takes longer than 10
    seconds you just want GeoServer to not return anything?

    Note that if you break the client connection pipe then GeoServer is
    smart enough to stop that connection. So that could be one way to go
    about it, just make sure the client closes their connection. That will
    probably stop it as quickly as anything you could hack in to GeoServer,
    since that hack would use the exact same mechanism to stop.

    best regards,

    Chris

     >
     > Regards,
     > Lee Wai See
     > ST Electronics (Info-Software Systems) Pte Ltd
     >
     > -----Original Message-----
     > From: Chris Holmes [mailto:cholmes@anonymised.com
    <mailto:cholmes@anonymised.com>]
     > Sent: Thursday, July 27, 2006 4:17 AM
     > To: Lee Wai See
     > Cc: geoserver-users@lists.sourceforge.net
    <mailto:geoserver-users@lists.sourceforge.net>
     > Subject: Re: [Geoserver-users] Session timeout for GeoServer
     >
     > Lee Wai See wrote:
     >> Hi,
     >>
     >> Is there any way to set session timeout for GeoServer?
     > No, not currently. Probably would not be too hard to implement.
     >
     >>
     >> What I understand is that whenever a request is sent to
    GeoServer, there
     >> will be a new session created for GeoServer. How can I set the
    timeout
     >> for these sessions?
     > You may also consider setting it in your servlet container, that
    may be
     > the cleaner way to do it? Note that I think your use of
    'session' isn't
     > quite the way it's generally used, a session is like when you're
     > navigating a series of web pages, as you're logged in. You seem
    to be
     > wanting a timeout for a single response? Or am I reading what
    you wrote
     > wrong?
     >
     > Chris
     >
     >>
     >> Would greatly appreciate some guidance on this. Thanks a lot.
     >>
     >> Regards,
     >> Lee Wai See
     >> ST Electronics (Info-Software Systems) Pte Ltd
     >>
     >> [This e-mail is confidential and may be priviledged. If you are
    not the
     >> intended recipient, please kindly notify us immediately and
    delete the
     > message
     >> from your system; please do not copy or use it for any purpose, nor
     > disclose
     >> its contents to any other person. Thank you.]
     >> ---ST Electronics Group---
     >>
    ------------------------------------------------------------------------

     >>
    -------------------------------------------------------------------------
     >> Take Surveys. Earn Cash. Influence the Future of IT
     >> Join SourceForge.net's Techsay panel and you'll get the chance
    to share
     > your
     >> opinions on IT & business topics through brief surveys -- and
    earn cash
     >>
    http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
    <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV&gt;
     >>
    ------------------------------------------------------------------------
     >>
     >> _______________________________________________
     >> Geoserver-users mailing list
     >> Geoserver-users@lists.sourceforge.net
    <mailto:Geoserver-users@lists.sourceforge.net>
     >> https://lists.sourceforge.net/lists/listinfo/geoserver-users
     >>
     >> !DSPAM:1003,44c77362316678365517736!
     >

    --
    Chris Holmes
    The Open Planning Project
    http://topp.openplans.org

    -------------------------------------------------------------------------
    Take Surveys. Earn Cash. Influence the Future of IT
    Join SourceForge.net's Techsay panel and you'll get the chance to
    share your
    opinions on IT & business topics through brief surveys -- and earn cash
    http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
    <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV&gt;
    _______________________________________________
    Geoserver-users mailing list
    Geoserver-users@lists.sourceforge.net
    <mailto:Geoserver-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,44ca2955143341804284693!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Chris,

I think I understand the confusion.

Every time you make a request to a servlet container, the servlet container has the opportunity to create a "javax.servlet.http.HttpSession". Generally this is done by having some code running in the servlet container call "HttpServletRequest.getSession(boolean b)"

This session object then causes the response headers in the HttpServletResponse to include a cookie (by default, at least) and it's then assumed by the servlet container that subsequent requests from that same host will cause the internal of the container to link up that HttpSession object with incoming HttpRequests (keyed by the browsers cookie value).

This is the basic mechanism for server-side statefulness in J2EE.

However, WMS/WFS are stateless, so there's no need to create these "HttpSession" objects and store them in a big hashtable somewhere inside tomcat, waiting for a browser's JSESSIONID cookie that's never going to show up.

"Now wait!" you're probably saying. "geoserver doesn't call 'getSession(boolean b)' explicitly anywhere! We don't MAKE those sessions, knowing that we're a stateless program!"

Except that that's not true:

sfarber@anonymised.com geoserver-trunk $ find . -name "*.java" | xargs -l1 grep -nHri getSession | wc -l
67
sfarber@anonymised.com geoserver-trunk $

So every geoserver request calls 'getSession()', thereby forcing the container to create a new session object, and those session objects (while relatively small) do stick around in the container session storage for a while.

I think the fix is to try and replace calls to "getSession" with calls to "getRequest" and see if we can get the info we're looking for from some place else in the API.

Make sense?

--saul

What resources does it hold on to? If it's not releasing resources then that's a problem. But I don't quite understand the number of sessions growing fast, when wms and wfs are stateless. Or do we just need to set a default of expiring sessions after a minute or so? A new session is created for every WMS/WFS call? I'm not sure what resources are being held on to though, as I'm pretty positive we release all the database connections and whatnot right away.

best regards,

Chris

Chris,

On 7/28/06, Chris Holmes <cholmes@anonymised.com> wrote:

Corey Puffalt wrote:

[…]

That said, I think a bug should be filed because as far as I can tell,
both the WMS & WFS protocols are stateless so GeoServer shouldn’t be
creating a session. (I’m not as familiar with WFS but WMS is definitely
stateless).
Yeah, this is the issue for me, is that the protocols are inherently
stateless. So what is the bug that needs to be filed?

The bug is that GeoServer shouldn’t be creating HttpSessions at all since it shouldn’t need them (except for the administration web interface). I’m not very familiar with the GeoServer codebase but I’ve noticed that servlet.getSession() is called a lot in order to gain access to ServletContext like so:

HttpSession session = request.getSession();
ServletContext context = session.getServletContext();

This isn’t necessary since the ServletContext is available directly from Servlet and could be stored elsewhere for use later.

What resources does it hold on to? If it’s not releasing resources then
that’s a problem. But I don’t quite understand the number of sessions
growing fast, when wms and wfs are stateless. Or do we just need to set
a default of expiring sessions after a minute or so? A new session is
created for every WMS/WFS call? I’m not sure what resources are being
held on to though, as I’m pretty positive we release all the database
connections and whatnot right away.

Simply creating a ServletSession ties up resources on the server whether you’re storing anything in it or not. Expiring sessions after a minute or so would fall into the “hack” category.

Corey

Cool, thanks for the explanations guys. Yeah, go ahead and file a bug.

Jody, I think you originally designed this, as the way to get at the configuration data. Is there an easy fix, or does it involve rewriting how we access the configuration? If there's an easy way I'd like to do it soon, if not we should note it for when we redo the configuration. But I feel we may actually be somewhat tied to it for now.

Chris

Corey Puffalt wrote:

Chris,

On 7/28/06, *Chris Holmes* <cholmes@anonymised.com <mailto:cholmes@anonymised.com>> wrote:

    Corey Puffalt wrote:

[...]

     > That said, I think a bug should be filed because as far as I can
    tell,
     > both the WMS & WFS protocols are stateless so GeoServer shouldn't be
     > creating a session. (I'm not as familiar with WFS but WMS is
    definitely
     > stateless).
    Yeah, this is the issue for me, is that the protocols are inherently
    stateless. So what is the bug that needs to be filed?

The bug is that GeoServer shouldn't be creating HttpSessions at all since it shouldn't need them (except for the administration web interface). I'm not very familiar with the GeoServer codebase but I've noticed that servlet.getSession() is called a lot in order to gain access to ServletContext like so:

        HttpSession session = request.getSession();
        ServletContext context = session.getServletContext();

This isn't necessary since the ServletContext is available directly from Servlet and could be stored elsewhere for use later.

    What resources does it hold on to? If it's not releasing resources then
    that's a problem. But I don't quite understand the number of sessions
    growing fast, when wms and wfs are stateless. Or do we just need to set
    a default of expiring sessions after a minute or so? A new session is
    created for every WMS/WFS call? I'm not sure what resources are being
    held on to though, as I'm pretty positive we release all the database
    connections and whatnot right away.

Simply creating a ServletSession ties up resources on the server whether you're storing anything in it or not. Expiring sessions after a minute or so would fall into the "hack" category.

Corey
!DSPAM:1003,44ca3231146911995013331!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Hi everyone,

Thanks so much for the explanation and discussion. I have a few more
questions, so hope you guys could just bear with me.

1. By setting the session timeout in the web.xml in the WEB-INF directory
for GeoServer, does it mean that GeoServer will not return anything if a
request takes longer than the timeout I set?

2. Can I conclude that the issue I raised is a result of the bug discussed
and I would not see my number of sessions exploding in Tomcat (even when I
am making requests to GeoServer at intervals of 10secs) when this bug is
fixed in newer versions of GeoServer? By then, I would no longer need to
set the session timeout in the GeoServer web.xml, right?

Thanks.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

Cool, thanks for the explanations guys. Yeah, go ahead and file a bug.

Jody, I think you originally designed this, as the way to get at the
configuration data. Is there an easy fix, or does it involve rewriting
how we access the configuration? If there's an easy way I'd like to do
it soon, if not we should note it for when we redo the configuration.
But I feel we may actually be somewhat tied to it for now.

Chris

Corey Puffalt wrote:

Chris,

On 7/28/06, *Chris Holmes* <cholmes@anonymised.com
<mailto:cholmes@anonymised.com>> wrote:

    Corey Puffalt wrote:

[...]

     > That said, I think a bug should be filed because as far as I can
    tell,
     > both the WMS & WFS protocols are stateless so GeoServer shouldn't
be
     > creating a session. (I'm not as familiar with WFS but WMS is
    definitely
     > stateless).
    Yeah, this is the issue for me, is that the protocols are inherently
    stateless. So what is the bug that needs to be filed?

The bug is that GeoServer shouldn't be creating HttpSessions at all
since it shouldn't need them (except for the administration web
interface). I'm not very familiar with the GeoServer codebase but I've
noticed that servlet.getSession() is called a lot in order to gain
access to ServletContext like so:

        HttpSession session = request.getSession();
        ServletContext context = session.getServletContext();

This isn't necessary since the ServletContext is available directly from
Servlet and could be stored elsewhere for use later.

    What resources does it hold on to? If it's not releasing resources
then
    that's a problem. But I don't quite understand the number of
sessions
    growing fast, when wms and wfs are stateless. Or do we just need to
set
    a default of expiring sessions after a minute or so? A new session
is
    created for every WMS/WFS call? I'm not sure what resources are
being
    held on to though, as I'm pretty positive we release all the
database
    connections and whatnot right away.

Simply creating a ServletSession ties up resources on the server whether
you're storing anything in it or not. Expiring sessions after a minute
or so would fall into the "hack" category.

Corey
!DSPAM:1003,44ca3231146911995013331!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the message
from your system; please do not copy or use it for any purpose, nor disclose
its contents to any other person. Thank you.]
---ST Electronics Group---

leewse@anonymised.com wrote:

Hi everyone,

Thanks so much for the explanation and discussion. I have a few more
questions, so hope you guys could just bear with me.

1. By setting the session timeout in the web.xml in the WEB-INF directory
for GeoServer, does it mean that GeoServer will not return anything if a
request takes longer than the timeout I set?

Unclear - if GeoServer is actively returning something I'm not sure if the session timeout will kill it. The timeout may just be when you're idle. And actually, GeoServer shouldn't need any session information when it's returning a response. So there's a decent chance it will work fine. Also note that GeoServer pretty much always starts streaming responses, so you'll get something.

And the minimum session timeout is one minute, and GeoServer rarely takes that long to respond - you have to be requesting a ton of data. Setting that minimum may make it annoying to configure GeoServer through the web admin, as it'd probably keep making you login, so I'd set it after I got everything configured.

2. Can I conclude that the issue I raised is a result of the bug discussed
and I would not see my number of sessions exploding in Tomcat (even when I
am making requests to GeoServer at intervals of 10secs) when this bug is
fixed in newer versions of GeoServer? By then, I would no longer need to
set the session timeout in the GeoServer web.xml, right?

Yes. Though this bug may be a decent bit of work, so may not get fixed soon.

Thanks.

Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd

Cool, thanks for the explanations guys. Yeah, go ahead and file a bug.

Jody, I think you originally designed this, as the way to get at the
configuration data. Is there an easy fix, or does it involve rewriting
how we access the configuration? If there's an easy way I'd like to do
it soon, if not we should note it for when we redo the configuration.
But I feel we may actually be somewhat tied to it for now.

Chris

Corey Puffalt wrote:

Chris,

On 7/28/06, *Chris Holmes* <cholmes@anonymised.com
<mailto:cholmes@anonymised.com>> wrote:

    Corey Puffalt wrote:

[...]

     > That said, I think a bug should be filed because as far as I can
    tell,
     > both the WMS & WFS protocols are stateless so GeoServer shouldn't
be
     > creating a session. (I'm not as familiar with WFS but WMS is
    definitely
     > stateless).
    Yeah, this is the issue for me, is that the protocols are inherently
    stateless. So what is the bug that needs to be filed?

The bug is that GeoServer shouldn't be creating HttpSessions at all
since it shouldn't need them (except for the administration web
interface). I'm not very familiar with the GeoServer codebase but I've
noticed that servlet.getSession() is called a lot in order to gain
access to ServletContext like so:

        HttpSession session = request.getSession();
        ServletContext context = session.getServletContext();

This isn't necessary since the ServletContext is available directly from
Servlet and could be stored elsewhere for use later.

    What resources does it hold on to? If it's not releasing resources
then
    that's a problem. But I don't quite understand the number of
sessions
    growing fast, when wms and wfs are stateless. Or do we just need to
set
    a default of expiring sessions after a minute or so? A new session
is
    created for every WMS/WFS call? I'm not sure what resources are
being
    held on to though, as I'm pretty positive we release all the
database
    connections and whatnot right away.

Simply creating a ServletSession ties up resources on the server whether
you're storing anything in it or not. Expiring sessions after a minute
or so would fall into the "hack" category.

Corey

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete the message
from your system; please do not copy or use it for any purpose, nor disclose
its contents to any other person. Thank you.]
---ST Electronics Group---

!DSPAM:1003,44caebb8199851365099012!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org