Re: AW: AW: the server add cpu

2022-04-26 Thread zhan...@51tuiyi.com
Thank you very much. I will try to check it out, but it seems a bit weird  



zhan...@51tuiyi.com
 
From: Thomas Hoffmann (Speed4Trade GmbH)
Date: 2022-04-23 02:10
To: Tomcat Users List
Subject: AW: AW: the server add cpu
 
> -Ursprüngliche Nachricht-
> Von: zhan...@51tuiyi.com 
> Gesendet: Donnerstag, 21. April 2022 04:19
> An: users 
> Betreff: Re: AW: the server add cpu
> 
> Hello:
> Thank you for your reply.  There is a strange problem here. After we add
> CPU, tomcat is less responsive and takes up a higher percentage of CPU than
> before. I tried to use Numactl to bind CPU to run Tomcat, but tomcat was
> bound to node0.  Much faster than binding node1 or not binding. Do you
> know why
> 
> Greetings,
> ZhangYu
> 
> 
> 
> zhan...@51tuiyi.com
> 
> From: Thomas Hoffmann (Speed4Trade GmbH)
> Date: 2022-04-21 05:14
> To: Tomcat Users List
> Subject: AW: the server add cpu
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: zhan...@51tuiyi.com 
> > Gesendet: Mittwoch, 20. April 2022 12:42
> > An: users 
> > Betreff: the server add cpu
> >
> > tomcat version : v9.0.38
> > os: centos7.9
> >
> > JAVA_OPTS="$JMX_MONITOR -server -Xms20g -Xmx20g  -Xss512k -
> > XX:+AggressiveOpts -XX:+UseBiasedLocking  -XX:+UseG1GC  -
> > XX:+UseFastAccessorMethods   -XX:MaxGCPauseMillis=100  -
> > Djava.security.egd=file:/dev/./urandom -XX:ParallelGCTh
> > reads=25 -XX:ConcGCThreads=6 -XX:NewRatio=1 -XX:SurvivorRatio=8
> >
> >
> > server.xml:
> >   > protocol="org.apache.coyote.http11.Http11Nio2Protocol"
> > executor="tomcatThreadPool"
> > compression="on"
> > compressionMinSize="2048"
> > maxThreads="1000"
> > minSpareThreads="100"
> > enableLookups="false"
> > redirectPort="8443"
> > acceptCount="1000"
> >
> > server="bj-jy-lsy163"5218R
> > maxHttpHeaderSize="1048576"
> >
> > socket.processorCache="1000"
> > socket.bufferPoolSize="1000"
> > processorCache="1000"
> >
> > keepAliveTimeout="1"
> > maxKeepAliveRequests="-1"
> > connectionTimeout="5000"
> > disableUploadTimeout="true" URIEncoding="UTF-8" />
> >
> >  > />
> >
> > question:
> > Our server Dell R440 originally has a 5218R CPU, which is 20 cores.
> > Under the above configuration, Tomcat occupies 50-60% of the CPU. The
> > performance is ok and the return speed is relatively low.The CPU usage
> > remains the same, or even slightly increases, while the return speed of the
> slow ones increases.
> > Theoretically, with the increase of CPU, the processing speed will be
> > faster, while the return speed should be reduced, which is very
> > abnormal. Could you help analyze the probl
> >
> >
> > zhan...@51tuiyi.com
> 
> Hello,
> 
> just some questions about the last part.
> If you add CPUs, why should the processing speed increase?
> In most cases, when you add CPUs, you can server more clients, but you
> can't serve one client faster.
> Depending on the program, more CPUs can also reduce the response time
> because the requests might access a shared resource (e.g. database table,
> filesystem, ...) Whether your application scales well depends heavily on the
> programming and involved systems.
> 
> You could test your program with a profiler and check, if there are some
> hotspots in your program.
> Or you can use tools like datadog to collect metrics of the program.
> 
> Greetings,
> Thomas
> 
 
Hello,
 
it is hard or almost impossible to tell without knowing all the details of the 
application.
If you have a shared resource (e.g. global lock on a database table, a 
connection pool which might be exhausted, ...) then adding CPUs could slow down 
the system.
E.g. if 50 threads are struggling to get a connection from the (too small) 
pool, then the response time will be slower than 20 threads trying to get a 
connection.
 
I can only recommend to test with a little dummy application to see whether the 
system itself scales properly.
E.g. just use one jsp file with a Thread.sleep(200) for example. One core 
should server 5 requests/s.
Scaling to 50 cores should deliver 250 requests/s.
(without taking overhead into account, like processing time, load of the OS 
etc. The real achieved values are a bit lower therefore)
 
If this base system scales as expected, then try again with the application. 
Thus you can at least figure out which part is not scaling well.
 
Greetings,
Thomas
 
 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
 


Re: AW: the server add cpu

2022-04-20 Thread zhan...@51tuiyi.com
Hello: 
Thank you for your reply.  There is a strange problem here. After we add CPU, 
tomcat is less responsive and takes up a higher percentage of CPU than before. 
I tried to use Numactl to bind CPU to run Tomcat, but tomcat was bound to 
node0.  Much faster than binding node1 or not binding. Do you know why  

Greetings,
ZhangYu



zhan...@51tuiyi.com
 
From: Thomas Hoffmann (Speed4Trade GmbH)
Date: 2022-04-21 05:14
To: Tomcat Users List
Subject: AW: the server add cpu
 
 
> -Ursprüngliche Nachricht-
> Von: zhan...@51tuiyi.com 
> Gesendet: Mittwoch, 20. April 2022 12:42
> An: users 
> Betreff: the server add cpu
> 
> tomcat version : v9.0.38
> os: centos7.9
> 
> JAVA_OPTS="$JMX_MONITOR -server -Xms20g -Xmx20g  -Xss512k -
> XX:+AggressiveOpts -XX:+UseBiasedLocking  -XX:+UseG1GC  -
> XX:+UseFastAccessorMethods   -XX:MaxGCPauseMillis=100  -
> Djava.security.egd=file:/dev/./urandom -XX:ParallelGCTh
> reads=25 -XX:ConcGCThreads=6 -XX:NewRatio=1 -XX:SurvivorRatio=8
> 
> 
> server.xml:
>   protocol="org.apache.coyote.http11.Http11Nio2Protocol"
> executor="tomcatThreadPool"
> compression="on"
> compressionMinSize="2048"
> maxThreads="1000"
> minSpareThreads="100"
> enableLookups="false"
> redirectPort="8443"
> acceptCount="1000"
> 
> server="bj-jy-lsy163"5218R
> maxHttpHeaderSize="1048576"
> 
> socket.processorCache="1000"
> socket.bufferPoolSize="1000"
> processorCache="1000"
> 
> keepAliveTimeout="1"
> maxKeepAliveRequests="-1"
> connectionTimeout="5000"
> disableUploadTimeout="true" URIEncoding="UTF-8" />
> 
> 
> 
> question:
> Our server Dell R440 originally has a 5218R CPU, which is 20 cores. Under the
> above configuration, Tomcat occupies 50-60% of the CPU. The performance
> is ok and the return speed is relatively low.The CPU usage remains the same,
> or even slightly increases, while the return speed of the slow ones increases.
> Theoretically, with the increase of CPU, the processing speed will be faster,
> while the return speed should be reduced, which is very abnormal. Could
> you help analyze the problem
> 
> 
> zhan...@51tuiyi.com
 
Hello,
 
just some questions about the last part.
If you add CPUs, why should the processing speed increase?
In most cases, when you add CPUs, you can server more clients, but you can't 
serve one client faster.
Depending on the program, more CPUs can also reduce the response time because 
the requests might access a shared resource (e.g. database table, filesystem, 
...)
Whether your application scales well depends heavily on the programming and 
involved systems.
 
You could test your program with a profiler and check, if there are some 
hotspots in your program.
Or you can use tools like datadog to collect metrics of the program.
 
Greetings,
Thomas
 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


the server add cpu

2022-04-20 Thread zhan...@51tuiyi.com
tomcat version : v9.0.38
os: centos7.9

JAVA_OPTS="$JMX_MONITOR -server -Xms20g -Xmx20g  -Xss512k -XX:+AggressiveOpts 
-XX:+UseBiasedLocking  -XX:+UseG1GC  -XX:+UseFastAccessorMethods   
-XX:MaxGCPauseMillis=100  -Djava.security.egd=file:/dev/./urandom 
-XX:ParallelGCTh
reads=25 -XX:ConcGCThreads=6 -XX:NewRatio=1 -XX:SurvivorRatio=8


server.xml:
 



question:
Our server Dell R440 originally has a 5218R CPU, which is 20 cores. Under the 
above configuration, Tomcat occupies 50-60% of the CPU. The performance is ok 
and the return speed is relatively low.The CPU usage remains the same, or even 
slightly increases, while the return speed of the slow ones increases. 
Theoretically, with the increase of CPU, the processing speed will be faster, 
while the return speed should be reduced, which is very abnormal. Could you 
help analyze the problem


zhan...@51tuiyi.com