Using timeout webclient

Forum to discuss the Web client version of Servoy.

Using timeout webclient

Postby martinh » Wed Mar 17, 2010 10:53 am

Hi,

You can set a timeout value for webclients in the configuration file web.xml
I've set this value to 20 minutes.

What I see happen is that users start webclient and then close the browser or surf to another site.

It looks like that this setting will only work in case the user is doing some action in the webclient within Servoy and if the timeout value has exceeded, that the user gets session expired message.
But in the mean time this user keeps a license in use.

I would like to see that the Servoy Application Server would automatically closes this client when the timeout value has exceeded, so that the license becomes free (only webclient, not smartclient)

Should it work like this?
And can it work like this? Maybe by settting some configuration variable?

Martin
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Using timeout webclient

Postby Andrei Costescu » Thu Mar 18, 2010 9:38 am

The app. server should close the web-clients/release used licenses when the client is no longer interacting with server (with a timeout of course). Doesn't this happen already?
Otherwise server would probably fill-up all licenses in no-time.

Or do you mean that this only happens if the client does not close the browser and doesn't browse to other page? The license should be released after a timeout in this case as well.
So if the client becomes idle for more then timeout it should get disconnected from the server.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Using timeout webclient

Postby Andrei Costescu » Thu Mar 18, 2010 10:24 am

You might notice that the client doesn't disconnect exactly when you are using AJAX and the user does not close the page/browse away from the page. (cause in this case AJAX requests do happen every 5 (configurable) sec - so the client is not considered "idle")
Wanted to clarify this as my previous post implied that the client would disconnect in this case as well.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Using timeout webclient

Postby martinh » Thu Mar 18, 2010 10:49 am

Andrei Costescu wrote:Otherwise server would probably fill-up all licenses in no-time.


This is exactly what was happening. My customer did a mailing. All the receipients had a look at the web application.
Just a short look and then they went back to work again.
I had about 30 webclients idle for more than 30 minutes, keeping all a licensie.

See the situation below.

The web.xml contains the following:

Code: Select all
  <!-- ==================== Default Session Configuration ================= -->
  <!-- You can set the default session timeout (in minutes) for all newly   -->
  <!-- created sessions by modifying the value below.                       -->

    <session-config>
        <session-timeout>20</session-timeout>
    </session-config>


The server time is:

Code: Select all
Server Information
Servoy version 4.1.5 -build 687
Repository version 35 (895d61ef-3255-446e-966d-f89399321361)
Current time: Thu Mar 18 09:39:42 CET 2010
Uptime: 9 days 17 hours 9 minutes 55 seconds


And the one of the connected clients is:

Code: Select all
Solution: havelaar_webshop Total number of clients for this solution: 1
Client: 81.82.196.25[81.82.196.25] (Servoy Web Client)
   
Client logged in:   Thu Mar 18 09:01:12 CET 2010
Client idle since:   Thu Mar 18 09:02:10 CET 2010


So this client should have been disconnected by the application server (37 minutes are past)
The client has still the application in the webbrowser, but went away for drinking a coffee for 45 minutes (in this case it's me :lol: )

So I guess this client should have been disconnected.

Now at 9:44 I even closed the webbrowser tabpanel where the solution was running. So there is really no connection anymore.
Now I'll wait another 20 minutes to see if that changes anything.

Martin
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Using timeout webclient

Postby Andrei Costescu » Thu Mar 18, 2010 11:35 am

The "Client idle since" is not the same as browser session idle. It takes into account client operations such as login, queries, locks, transactions, ....
The session will not be marked as idle if you keep the browser open because of the AJAX requests that keep happening (as I mentioned in previous post).

So, in your case, client will be disconnected in 20 min after you closed the browser tab.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Using timeout webclient

Postby martinh » Thu Mar 18, 2010 11:50 am

Thanks Andrei,

I'll check if the disconnect works when closing the browser tab.

But I also would like to see that I can disconnect a client after a certain idle time (the idle time that is shown on the Clients page)

Is that technically possible?
In that case I'll make a feature request.

Martin
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Using timeout webclient

Postby Andrei Costescu » Thu Mar 18, 2010 12:08 pm

It is technically possible, although in my opinion it's not such a good idea. You might have ppl. editing a text area or some field for 20 minutes and then they end up disconnected (maybe other situations as well that do not influence the idle time-stamp from admin page). I think it's better to teach users to close the apps./windows that they do not use ;). Web-client does take into account the fact that some users might have already closed the browser window when computing license usage.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Using timeout webclient

Postby patrick » Thu Mar 18, 2010 12:14 pm

I would like to see that the Servoy Application Server would automatically closes this client when the timeout value has exceeded, so that the license becomes free (only webclient, not smartclient)


You could have a look at our UserManager plugin. That allows you exactly that. It has a maxWebClientIdleTime that you can set (a different setting is available for smart clients). You could even set a client specific idle time.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Using timeout webclient

Postby martinh » Thu Mar 18, 2010 12:15 pm

Andrei Costescu wrote:It is technically possible, although in my opinion it's not such a good idea. You might have ppl. editing a text area or some field for 20 minutes and then they end up disconnected (maybe other situations as well that do not influence the idle time-stamp from admin page). I think it's better to teach users to close the apps./windows that they do not use ;). Web-client does take into account the fact that some users might have already closed the browser window when computing license usage.


Then this idle timeout should depend on the solution. In case I have an application data-entry, then I agree that it is not a good idea. Here I know who are the users
But I have also solutions which are webshops. In that case it should be disconnect. In this case I don't know the users, so I can't teach them. It can be anybody. That is the problem with the license-model of Servoy. With webshops you don't know how many people will connect. Normally it is very limited, but after a mailing I see a huge number of people trying to connect.

I'll make request to disconnect webclients after a certain idle time
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Using timeout webclient

Postby martinh » Thu Mar 18, 2010 12:26 pm

patrick wrote:
I would like to see that the Servoy Application Server would automatically closes this client when the timeout value has exceeded, so that the license becomes free (only webclient, not smartclient)


You could have a look at our UserManager plugin. That allows you exactly that. It has a maxWebClientIdleTime that you can set (a different setting is available for smart clients). You could even set a client specific idle time.


Thanks I'll have a look at it
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Using timeout webclient

Postby martinh » Thu Mar 18, 2010 12:52 pm

Andrei Costescu wrote:So, in your case, client will be disconnected in 20 min after you closed the browser tab.


Indeed that is working
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Using timeout webclient

Postby udrescu_bogdan » Mon Dec 20, 2010 7:36 pm

How can I read in my solution the "Client idle since" time for each client?
udrescu_bogdan
 
Posts: 336
Joined: Fri Jun 18, 2010 3:27 pm
Location: Craiova, Romania

Re: Using timeout webclient

Postby Harjo » Mon Dec 20, 2010 10:26 pm

you can't.

you need the usermanager plugin for that!
viewtopic.php?f=34&t=13858#p72577
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Using timeout webclient

Postby maria » Tue Dec 21, 2010 12:56 am

Why don't you just set a logout() method in onHide of the main solution form?
So whenever users navigate away from solution they're simply logged out and the license is released.

Cheers,
Maria
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Using timeout webclient

Postby udrescu_bogdan » Tue Dec 21, 2010 1:15 am

I hope I can read the idle time, as the server also knows it. I can read the start time of each client from the server database, but this is not enough. The idle time would be useful to shutdown idle clients.

So, if anyone knows how to get it, even a simple workaround, I'm all ears :) Actually, a workaround would be to track all user actions directly in the application and to store the time of the last action. But this complicates the application, and I wouldn't do it. I'm looking for a simple solution.

Greetings,
Bogdan.
udrescu_bogdan
 
Posts: 336
Joined: Fri Jun 18, 2010 3:27 pm
Location: Craiova, Romania

Next

Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 11 guests

cron