Servoy Server or JVM "saturation"?

Hi,

in my customer environment I experiencing periodic poor performance on smart-client apparently due to server “saturation”.

Server envirmonment:

  • Linux Ubuntu 6 - 512MB RAM (VMWare Virtual Machine hosted on Windows 2000 Server 1GB RAM) - Before was a real server: the problem already existed
  • Java 1.6 (before was Java 1.5: the problem already existed)
  • Servoy 3.5.7
  • About 15 smart-clients

In order to restrict my analisys during poor performance event, I monitored servoy-server java process CPU and Memory consuption while disconnecting one by one each smart-client.
CPU was constantly 50% (average) and memory consumption about 256MB, even when all smart-client were disconnected.

The only action that solved the problem was restarting servoy server.

It make me think that

  • low performance doesn’t depend on clients or one particular client
  • low performance doesn’t depend on network issues
  • low performance doesn’t depend on virtualized environment
  • low performance doesn’t depend on JVM version
  • low performance depends on servoy-server java process
  • every time the servoy-server is restarted, memory consuption start from 64MB and rise up to 256MB (usually after one week); never is deallocated

This is the command that starts servoy-server:

java -Djava.security.egd=file:/dev/urandom -Djava.awt.headless=true -Xmx 256m -Xms64m -XX:MaxPermSize=128m -classpath .:lib/ohj-jewt.jar:lib/MRJAdapter.jar:lib/compat141.jar:lib/commons-codec.jar:lib/commons-httpclient.jar:lib/activation.jar:lib/antlr.jar:lib/commons-collections.jar:lib/commons-dbcp.jar:lib/commons-fileupload-1.0.jar:lib/commons-logging.jar:lib/commons-pool.jar:lib/concurrent.jar:lib/dom4j.jar:lib/help.jar:lib/hibernate3.jar:lib/j2db.jar:lib/j2dbdev.jar:lib/jdbc2_0-stdext.jar:lib/jmx.jar:lib/jndi.jar:lib/js.jar:lib/jta.jar:lib/BrowserLauncher2.jar:lib/jug.jar:lib/log4j.jar:lib/mail.jar:lib/ohj-jewt.jar:lib/oracle_ice.jar:lib/server-bootstrap.jar:lib/servlet-api.jar:lib/wicket-extentions.jar:lib/wicket.jar:lib/wicket-calendar.jar:lib/xerces.jar:lib/concurrent.jar:lib/slf4j-api.jar:lib/slf4j-log4j.jar:lib/joda-time.jar:lib/rmitnl.jar:lib/networktnl.jar com.servoy.j2db.server.ApplicationServer “$@” 1>> server.log 2>> server.log

How do I solve this problem?

Regards
Emanuele

Welcome to the club. I’m facing same kind of problems.
On my own system all works fine, but customer sometimes has to wait 30-45 seconds before a form is loaded. And the time is increasing.
I’ve checked the performance data, but there are no queries that take long time (except one because of a locked record); There wasn’t done a dirty read.

The problem is that I have a customer “saturation” now. He doesn’t accept this anymore.

So if anyone has solutions for this situation please let us know.

I’ve found on the forum already the following:

servoy.useObjectPool: I’ve set this on false
servoy.vmClientArgs: -XX:SoftRefLRUPolicyMSPerMB=3600000

Also I’ve set the following settings in admin pages:

servoy.maxClientHeap: 1024
servoy.initialClientHeap: 256

I’ve installed the latest version of Java (1.6 update 7)
I’ve restarted the whole server so that all memory is released.

Also I noticed that there is no data broadcasting.
Printing 100 pages from Jasper Viewer to network printer hangs up the client.
When saving the Jasper Report first to pdf document and then print the document from Adobe Acrobat Reader, works well.

Servoy is running on a Windows 2003 server with SQL Server 2005
There are 6-7 simultanious clients running using smart client.

There are also some messages in the log. Can this has anything to do with it?

2008-10-13 17:02 TaskExecuter[5] ERROR com.servoy.j2db.dataprocessing.ClientManager java.rmi.ConnectException: Connection refused to host: 200.0.4.64; nested exception is: java.net.ConnectException: Connection timed out: connect 
2008-10-13 17:02 TaskExecuter[5] ERROR com.servoy.j2db.dataprocessing.ClientManager Error flushing message buffer to client 81db4629-bbc4-491d-8615-5e95a98ff36c, Connection refused to host: 200.0.4.64; nested exception is: java.net.ConnectException: Connection timed out: connect 
2008-10-13 16:58 TaskExecuter[0] ERROR com.servoy.j2db.dataprocessing.ClientManager java.rmi.ConnectException: Connection refused to host: 200.0.4.64; nested exception is: java.net.ConnectException: Connection timed out: connect 
2008-10-13 16:58 TaskExecuter[0] ERROR com.servoy.j2db.dataprocessing.ClientManager Error flushing message buffer to client 81db4629-bbc4-491d-8615-5e95a98ff36c, Connection refused to host: 200.0.4.64; nested exception is: java.net.ConnectException: Connection timed out: connect 
2008-10-13 16:58 TaskExecuter[1] ERROR com.servoy.j2db.dataprocessing.ClientManager java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: java.net.SocketException: Connection reset 
2008-10-13 16:58 TaskExecuter[1] ERROR com.servoy.j2db.dataprocessing.ClientManager Error flushing message buffer to client 81db4629-bbc4-491d-8615-5e95a98ff36c, Error unmarshaling return header; nested exception is: java.net.SocketException: Connection reset 
2008-10-13 16:34 TaskExecuter[5] ERROR com.servoy.j2db.dataprocessing.ClientManager java.rmi.ConnectException: Connection refused to host: 200.0.4.201; nested exception is: java.net.ConnectException: Connection timed out: connect 
2008-10-13 16:34 TaskExecuter[5] ERROR com.servoy.j2db.dataprocessing.ClientManager Error flushing message buffer to client 8d25c8a0-3a1d-40f2-a364-5c61cbf64b8b, Connection refused to host: 200.0.4.201; nested exception is: java.net.ConnectException: Connection timed out: connect 
2008-10-13 16:14 RMI TCP Connection(2795)-200.0.4.74 ERROR com.servoy.j2db.util.Debug Throwable

Martin

It seems to me your server just need more memory assigned (its very busy garbage collecting)

Try to:
-increase your server -Xmx 256m settting to -Xmx750m
-lower your ping delay in network settings on admin page (like 60 seconds)
-remove all non used plugins

Are you using many plugins?

Hi Jan,

-Xmx setting is that the servoy.initialClientHeap?

ApplicationServer.pingDelay was 300. I changed it to 60.

I’m using the following plugins:

IT2Be Menubar
I2TBe Tools
Jasper Plugin
Log plugin (Dr Maison if I’m well)
XML Plugin

I don’t have plugins installed that I’m not using.

Are there some settings that I have to fill in servoy.vmClientArgs?
I remember that when using IT2BE plugins that there are some recommended settings (-X … -XX … ) but I really don’t know how to use this.

Martin

-Xmx is the server side JVM max heap setting, this can be found in the wrapper.conf (if you are using the windows service) or server_server.bat/.sh

Do you have any Batch Processors running on your application server, or other type of cron jobs running?

No, I don’t

Hi

I am facing similar performance problems (reported them earlier already). Although I changed memory settings to high values, it doesn’t seem to change much, the Smart Client is still slow.We also have long running processes (50 hours +) and they get slower and slower over time. We tried quite a few different things (as suggested by the forum and Jan), but it didn’t help.
I definitely think there is somewhere something not very optimal. Strange thing is (for me) it’s the same behaviour whether we use the Smart Client or the Developer.

Any good ideas welcome, regards, Robert

Jan Blok:
It seems to me your server just need more memory assigned (its very busy garbage collecting)

Try to:
-increase your server -Xmx 256m settting to -Xmx750m
-lower your ping delay in network settings on admin page (like 60 seconds)
-remove all non used plugins

Are you using many plugins?

What is the effect of these settings?

servoy.maxClientHeap: 1024
servoy.initialClientHeap: 256

I changed my setting in the wrapper.conf file like Jan Blok adviced,

Try to:
-increase your server -Xmx 256m settting to -Xmx750m

but I thought MaxClientHeap does the same or I am wrong?

servoy.maxClientHeap and servoy.initialClientHeap are the memory setting pushed by Java webstart to the smartclient (only to be changed if you notice in about dialog in the client that the memory is running low)

Jan,

Thanks for the useful info.
I didn’t know about this About screen and the memory use.

I had before max heap space on 256 and I see now in the about screen that is uses 290-300.
So that will probably have caused hanging of the PC.

Can I keep the values

servoy.maxClientHeap: 1024
servoy.initialClientHeap: 256

Because otherwise Servoy puts it default on

servoy.maxClientHeap: <empty>
servoy.initialClientHeap: 64

Martin

Could you fix your issue by now? If yes, how do you get it to work?

Thomas

The memory reserved for Servoy was indeed increased, but it didn’t solve all the problems I had.
But the problems I have/had do probably nothing has to do with this memory setting.

Jan told me that hanging clients could have been caused by not enough memory for the garbage collector (if I understood right).
I must say that hanging clients didn’t occur anymore, but there haven’t been so much clients since that day.

So yes this setting could help to solve some problems, but it didn’t solve fully my problems, but as I said, the problems that still remain have probably nothing to do with memory.
So I think it is a good idea to use the settings that Jan advised.

Ok, thank you. I tried a lot by setting different Memory for the Servoy Server and the Clients. We also increased the physical RAM on each (Mac-) Client up to 2 GB, but the best memory setting (speaking from own one’s experience) depends on how big/complex the Servoy solution is. Sometimes I’m verry frustrated, because it’s so difficult to detect where the problems comes from and to understand/fix the issues/problems takes so much time.

Thomas

We are having the same problem with a customer that is hosting his solution on our servers.
With about 15-20 clients, the server java process eats up almost all CPU (99%) and memory is rising until about 1024MB :shock:
clients are deadslow than…

Here are the wrapper.conf settings:

# Java Additional Parameters
wrapper.java.additional.1=-Djava.awt.headless=true
wrapper.java.additional.2=-Duser.dir="C:\Servoy"
wrapper.java.additional.3=-XX:MaxPermSize=128m

# Initial Java Heap Size (in MB)
wrapper.java.initmemory=32

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=1024

We are using Servoy 3.5.10 & java 1.6
I have never seen that only 15 clients could eat up so much memory, on the server.

we are searching now for almost a week, how, when, and why this happens… but still no clue… somekind of memory leak???
Jan, how do I set the xmx value in the wrapper.conf? I could’nt find any property for that…

Harjo:
how do I set the xmx value in the wrapper.conf? I could’nt find any property for that…

wrapper.java.maxmemory=1024
is the Xmx setting

oke, than we still don’t get it, why only fifteen clients, can eat up so much memory,
there are no, batch processors, or what so ever…