How to monitor number of open connections in wildfly? - console

I'm using wildfly version 10.1.0.Final. I tried to figure out how to monitor open datasource connections so
1) i have a data source configured with statistics enabled. it has a pool max of 250
2) i created code that when invoked, it loops and obtains 1000 connections from the datasource (it obtains 100 then pauses for 10 seconds etc'. All obtained
connections are saved in an array. I then close the connections, in a similar manner (100 at a time, with 10 seconds delay)
3) when i start the application, it shows 9 out of 250 connections are used for that datasource. (Both Active and Max used)
when i invoke the above code, i continuously hit the Refresh results link in the console but the above two counts (Active and Max Used) remain at 9.
i also examined the obtained connections and they are different from each other.
Why is the count not changing as more and more connections are obtained?

Related

Difference between two perf events for intel processors

What is the difference between following perf events for intel processors:
UNC_CHA_DIR_UPDATE.HA: Counts only multi-socket cacheline Directory state updates memory writes issued from the HA pipe. This does not include memory write requests which are for I (Invalid) or E (Exclusive) cachelines.
UNC_CHA_DIR_UPDATE.TOR: Counts only multi-socket cacheline Directory state updates due to memory writes issued from the TOR pipe which are the result of remote transaction hitting the SF/LLC and returning data Core2Core. This does not include memory write requests which are for I (Invalid) or E (Exclusive) cachelines.
UNC_M2M_DIRECTORY_UPDATE.ANY: Counts when the M2M (Mesh to Memory) updates the multi-socket cacheline Directory to a new state.
The above description about perf events is taken from here.
In particular, if there is a directory update because of the memory write request coming from a remote socket then which perf event will account for that if any?
As per my understanding, since the CHA is responsible for handling the requests coming from the remote sockets via UPI, the directory updates which are caused by the remote requests should be reflected by UNC_CHA_DIR_UPDATE.HA or UNC_CHA_DIR_UPDATE.TOR. But when I run a program (which I will explain shortly), the UNC_M2M_DIRECTORY_UPDATE.ANY count is much larger (more than 34M) whereas the other two events have the count in the order of few thousand. Since there are no other writes happening other than those coming from the remote socket it seems that UNC_M2M_DIRECTORY_UPDATE.ANY measures the number of directory updates(and not the other two events which) happening due to remote writes.
Description of the system
Intel Xeon GOLD 6242 CPU (Intel Cascadelake architecture)
4 sockets with each socket having PMEM attached to it
part of the PMEM is configured to be used as a system RAM on sockets 2 and 3
OS: Linux (kernel 5.4.0-72-generic)
Description of the program:
Note: use numactl to bind the process to node 2 which is a DRAM node
Allocate two buffers of size 1GB each
Initialize these buffers
Move the second buffer to the PMEM attached to socket 3
Perform a data copy from the first buffer to the second buffer

R Shiny / shinyapps.io - Worker and Instance settings to maximize performance

Extra information relevant to this: https://shiny.rstudio.com/articles/scaling-and-tuning.html
I am trying to determine the best Worker and Instance settings for my Shiny App to make the user experience as smooth as possible. For the most part, traffic on the app is minimal, but there will be some times where traffic will be abnormally high such as when it is being presented to a large audience (maybe 100+ users?).
First, based on personal experience as well as this SO question., I am setting the "Max Connections" (the number of concurrent connections allowed per R worker process) to 1. This will avoid some strange 'interactions' between connections that share the same R worker.
I have a Professional subscription to shinyapps.io, which means each app has a maximum of 10 instances. In the settings for the app, I have the ability to adjust several values to determine when new instances are launched, when new workers are added or shared, etc.
Consider two scenarios:
I set it up so there is as many instances as possible, and additional workers fill in as they appear. If I have a max of 10 workers per instance, the first 10 connections would each start their own instance, and the 11th connection would end up joining one of those instances with a new worker.
I set it up to have as few instances as possible, adding workers until a new instance is needed. If max of 10 workers per instance, the first connection starts the instance, the next 9 start workers within that instance, and the 11th will start a new instance and worker.
What are the pros and cons to using either of these methods?
Does one increase performance? Are they the same?
Does having more workers on an instance slow computational speeds?
Thanks!
I'm wondering the same thing, but set "Max connection" to 1 seems not efficient to me, as they can be up to 50 isn't it

In Jmeter, how do you test the maximum bytes over time that a website can handle?

In Jmeter, I am using the "Bytes Throughput Over Time" to check the maximum bps that my website can handle. (To be exact, it's to check the maximum bps my website can handle after it has gone through my reverse proxy system)
It seems like if I just simply run one user, it will not be able to test the maximum bps. Here's an example photo of the graph using 5 threads, 0.5s ramp up, and 100 loops.
bps graph
Test properties
However, when I make it 100 threads, the bps increases by magnitudes. I suspect that this is because requests take time to send, so you can't get the maximum by waiting for each request to be done before sending a new one.
Then, what is the correct way to get the maximum bps? Is it by incrementally increasing the number of threads until there are error responses? Is it by using "Use multipart/form-data for POST" and downloading a file instead of doing a standard GET request?
Any help would be greatly appreciated.
When you increase the amount of threads JMeter will generate more new threads and they all execute the request you have in your test in parallel, thus more threads -> more requests sent simultaneously at your website -> overall bytes received per second increases.
What are you trying to achieve by finding this max bps value? Because there probably isn't one single correct way to do it.
If you just want to find the point where the bps doesn't increase anymore you could just add more threads until the bps stays the same and doesn't increase anymore, but you might not be able to generate and run enough threads for this on a single machine. You could be able to hit the max limit with fewer threads if you try to download a file or something like you suggested.

JMS Connection Latency

I am examining an application where a JBOSS Application Server communicates with satellite JBOSS Application Servers (1 main server, hundreds of satellites).
When observing in the Windows Resource Monitor I can view the connections and see the latency by satellite - most are sub-second, but I see 10 over 1 second, of those 4 over 2 seconds and 1 over 4 seconds. This is a "moment in time" view, so as connections expire and rebuild when they need, the trend can shift. I do observe the same pair of systems have a ping latency matching seen on the connection list - so I suspect it's connection related (slow pipe, congestion, or anything in the line between points A and B).
My question is what should be a target latency, keeping in mind the satellites are VPN'd from various field sites. I use 2 seconds as a dividing line to when I need the network team to investigate, I'd like to survey what rule of thumb do you use in evaluating when the latency for a transient connection starts peaking - is it over a second? I do observe the same pair of systems have a ping latency matching seen on the connection list - so I know it's connection related.

Maximum concurrent http connections for same domain between two servers

I have a Tomcat Server running which connects to another Tableau server. I need to make about 25 GET calls from Tomcat to Tableau. Now I am trying to thread this and let each thread create its own HTTP connection object and make the call. On my local system (Tomcat local, Tableau is remote), I notice that in this case each of my thread takes about 10 seconds average, so in total 10 seconds.
However, if I do this sequentially, each request takes 2 seconds, thereby total of 50.
My doubt is, when making requests in parallel, why does each take more than 2 seconds when it takes just 2 when done sequentially?
Does this have anything to do with maximum concurrent connections to same domain from one client (browser)? But here the request is going from my Tomcat server, not browser.
If yes, what is the default rule and is there any way to change that?
In my opinion, its most likely Context Switching Overhead that the system has to go through for each request and that is why you see longer times for individual requests ( compared to one sequential thread ) but significant gain in overall processing.
It makes sense to go for parallel processing when Context Switching Overhead is negligible compared to time taken in overall activity.

Resources