Jpos usage Cpu

122 views
Skip to first unread message

soltani...@gmail.com

unread,
Dec 28, 2021, 5:14:41 AM12/28/21
to jPOS Users
Hi 
I  run jpos in weblogic as service.I have a banking project , when I send many request to jpos , cpu usage in linux server increase.
also I have another project with jpos (simulator Iso8583)
when I send many request to jpos , cpu usage in linux server increase.
and cpu usage became 100 percent .
I dont have any crud database .

Why is CPU consumption increasing?
How can i manage session in jpos?
How can i manage resourse in jpos ?
How can i increase resource for jpos? Is there any config ?

Mark Salter

unread,
Dec 29, 2021, 10:07:15 AM12/29/21
to jpos-...@googlegroups.com
On 28/12/2021 10:14, soltani...@gmail.com wrote:
Hi 
I  run jpos in weblogic as service.I have a banking project , when I send many request to jpos , cpu usage in linux server increase.
also I have another project with jpos (simulator Iso8583)
when I send many request to jpos , cpu usage in linux server increase.
and cpu usage became 100 percent .
I dont have any crud database .
What do you have on the target setup?


Why is CPU consumption increasing?

Because load is increasing - as you indicated?

What are you doing with the requests?

Is each unique?

How many sockets to the target?

How many threads on the target?

You need to ask a smart question : http://www.catb.org/~esr/faqs/smart-questions.html#intro


This appears to be a test setup;  so reduce the cpu need on the target setup.

--

Mark

publickey - "marksalter@protonmail.com" - c18a77dc.asc
signature.asc

soltani...@gmail.com

unread,
Dec 30, 2021, 3:31:17 AM12/30/21
to jPOS Users
Hi

I attach Monitoring file in jpos for you,
Queues are filled but can not be emptied ,
why queues can not be emptied?

Thanks
jpos-monitoring.jpg

murtuza chhil

unread,
Dec 30, 2021, 7:13:25 AM12/30/21
to jPOS Users
You should look at  jpos'  profiler messages in the q2 log, will tell you which participants are taking long and perhaps consuming CPU.
JPOS' system monitor bean will log details of how many threads are active, which participant is doing what and what the txn mgr queue looks like.

> why queues can not be emptied?
Don't know which queues you are talking about. Spae/Queues are used heavily in jpos, you should be more specific.
Txn Mgr queues will only process entries if there are sessions available to process them. Session unavailability means you may have not configured sufficient sessions or your sessions are being blocked by participants (accessing db, sending requests out and waiting for too long to timeout etc).


You should test barebone jpos with jpos provided client and server simulator to see the throughput, cpu and memory metrics. Which will lead you to find issues in how you have setup your system.

-chhil

Mark Salter

unread,
Dec 30, 2021, 10:17:22 AM12/30/21
to jpos-...@googlegroups.com
Hi again.

I did not want your details, but wanted you to go and look and try to answer the questions I shared.

You have the access to the running instance so are best placed to see where the issue is.
So far we don't really know what your setup is.

--
Mark


Sent from ProtonMail mobile



-------- Original Message --------
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/a207464b-2e35-4640-b999-baaf3124646bn%40googlegroups.com.
publickey - EmailAddress(s=marksalter@pm.me) - 0x929AF469.asc
signature.asc

soltani...@gmail.com

unread,
Jan 2, 2022, 12:16:57 AM1/2/22
to jPOS Users
I increased the number of sessions in transaction manager and improved system performance
Thank u so much Mr  Chhil

Mark Salter

unread,
Jan 2, 2022, 9:18:00 AM1/2/22
to jpos-...@googlegroups.com


On 02/01/2022 05:16, soltani...@gmail.com wrote:
I increased the number of sessions in transaction manager and improved system performance
Thank u so much Mr  Chhil


Good to know you sorted the mis-configuration.


Can I check (for others that follow) quite how you also reduced the cpu usage - which was reported at 100% just by increasing the number of configured sessions?


Or was the "cpu usage in linux server increase. and cpu usage became 100 percent ." a mis-conception?

--

Mark

publickey - "marksalter@protonmail.com" - c18a77dc.asc
signature.asc

chhil

unread,
Jan 2, 2022, 9:41:48 AM1/2/22
to jpos-...@googlegroups.com
Be wary. Increasing sessions at times is only a temporary band aid and not fixing the underlying problem caused by participants blocking. At higher loads it can resurface as the sessions will be blocked and nothing left to process transactions. 

-chhil

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to a topic in the Google Groups "jPOS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jpos-users/3F1aW5AF1EY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/69fcec53-6b97-075a-cf35-7349157c3921%40protonmail.com.

soltani...@gmail.com

unread,
Jan 3, 2022, 1:58:05 AM1/3/22
to jPOS Users
Hi Mr  Mark

We could not reduce CPU usage This may be due to the using of the jpos service in weblogic I'm not sure about this.
Thanks
----------
Soltani

soltani...@gmail.com

unread,
Jan 3, 2022, 7:34:56 AM1/3/22
to jPOS Users
I found lock in participant,It is when we send data with mux and wait for response . we have wait 350ms
As the number of transactions increases, the queuing time gradually increases
ِdo you have solution for this problem Mr chili?
On Sunday, January 2, 2022 at 6:11:48 PM UTC+3:30 chi...@gmail.com wrote:

chhil

unread,
Jan 3, 2022, 7:52:03 AM1/3/22
to jpos-...@googlegroups.com
350ms amounts to nothing, there must be some other participants that take longer , this per participant info is available in the q2 log.
But of course if you started with 1 or 2 sessions than that is way under for any production system. 


-chhil

Mark Salter

unread,
Jan 3, 2022, 8:14:51 AM1/3/22
to jpos-...@googlegroups.com
You have access to your setup and need to look at the details instead of this guessing that you currently seem happy to live with.

That wait would be on the client end, that will not be burning could- waiting.

Time to ask a smart question, with the actual detail about what you have and what is actually happening. Currently you are just wasting your own time.

--
Mark



-------- Original Message --------
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/18cb6f44-e29c-412a-b74d-99be93e79382n%40googlegroups.com.
publickey - EmailAddress(s=marksalter@pm.me) - 0x929AF469.asc
signature.asc

Mostafa Soltani

unread,
Jan 3, 2022, 11:50:13 AM1/3/22
to jpos-...@googlegroups.com
Hi Mr Mark, 
I looked at all the details carefully
Time is very important to us. We have to respond to the request in less than a second. We don't have any database locks and we checked it in Oracle monitoring.
I am always happy, especially when I read your answers.
with regard
Soltani

Barzilai Spinak

unread,
Jan 3, 2022, 8:01:44 PM1/3/22
to jpos-...@googlegroups.com

Have you tried the QueryHost participant that is part of jPOS?
It uses muxes in an async fashion, so that the TransactionManager thread can be reused while we wait for the response from the mux.


--
Barzilai Spinak - jPOS Evangelist | Transactility, Inc. | Montevideo, Uruguay | e: bar...@transactility.com

Can I check (for others that follow) quite how you also reducedthe cpu usage - which was reported at 100% just by increasing thenumber of configured sessions?


soltani...@gmail.com

unread,
Jan 4, 2022, 4:35:24 AM1/4/22
to jPOS Users

Hi Mr.  Barspi

I didn't use from  QueryHost . I read document. How can I use asynchronous mode? Do you have sample code?

Thank you kindly


Siltani

Mark Salter

unread,
Jan 4, 2022, 7:30:33 AM1/4/22
to jpos-...@googlegroups.com

On 04/01/2022 09:35, soltani...@gmail.com wrote:
> I didn't use from  QueryHost . I read document. How can I
> use asynchronous mode? Do you have sample code?

Can I please check that we are all on the same undefined page?

The MUX use would be within your the test driver - not  on the target of
the test which is yourr weblogic based jpos solution?


Improving the throughput of the flow through the MUX to the target
system will only create more load for the target, something you are yet
to address the cpu use within/

You have still not indicated clearly where your 100% cpu is, nor what
your setup or intent here really is.


--

Mark

publickey - "marksalter@protonmail.com" - c18a77dc.asc
signature.asc
Message has been deleted

murtuza chhil

unread,
Jan 4, 2022, 9:19:12 PM1/4/22
to jPOS Users

For aync mux
https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/q2/iso/QMUX.java#L180-L201

The mux.request method signature is different.

public void request (ISOMsg m, long timeout, ISOResponseListener rl, Object handBack)

You implement a ISOResponseListener and pass it in. The handback object could be anything that you need to rely on to process the response when it's received. It could be an ISOMsg or a Context or whatever.

Your ISOResponseListener .responseReceived is invoked when a response is received. Your participant is not waiting for a response, it moves on to the next participant.

https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/q2/iso/QMUX.java#L537

You can see how the jpos queryhost (talking to an external entity) implements it here. The context is paused, meaning it will let the txn mgr free this session and allow another transaction to get processed (no blocking of sessions). When a response is received, the context is resumed and txn mgr participants processing flow resumes for. that transaction
https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/transaction/participant/QueryHost.java#L79

You can read a brief description of transaction continuations (pause/resume) here
https://jpos.org/blog/2007/04/transactionmanager-continuations/

-chhil

soltani...@gmail.com

unread,
Jan 5, 2022, 2:26:08 AM1/5/22
to jPOS Users
Thanks Mr Chhil
Reply all
Reply to author
Forward
0 new messages