A project for testing the correctness and performance of the EPICS CA software for Java. In particular the epics2web service is tested against clients configured to directly query a gateway via either CAJ or the newer Java 8 CA library.
On Windows run:
gradlew.bat build
On UNIX run:
gradlew build
The build script does everything including downloading all dependencies from the Internet.
Assumes UNIX. Append ".bat" to gradlew if on Windows.
- First run CAServer
The server creates 5,000 integer counter PVs which update at 100 times a second. The PVs are named counter0, counter1, etc.
gradlew run
- Next run one of the clients
gradlew client -Pclientargs=caj,hello
Where "caj" can be substituted for one of the clients and "hello" can be substituted for one of the tests
Client | Description |
---|---|
caj | JCA/CAJ |
j8 | Java 8 CA |
ws | Web Socket |
Test | Description |
---|---|
hello | Connects to counter0 PV for a few seconds |
throughput | Connects to 5,000 unique counter PVs for 30 seconds |
concurrency | Launches 100 internal clients, which then monitor 100 unique PVs each for 30 seconds |
slow | Similar to throughput test, but update callback puts thread to sleep for 10 seconds to slow things down; additionally ws client application recv-q buffer size is set to 512 bytes from default of 4MB so that backpressure is created much more quickly for ws client (caj and j8 don't have an application recv-q buffer, just OS recv-q) |
staggered | Creates 5 clients per second until 1000 have been created, and each one only monitors 5 channels for 3 seconds. This creates a flurry of connection and disconnection events. |
contention | Launches 5000 clients incrementally, 5 per second, each which monitors the same single shared PV for two minutes. Runs for 15 minutes. |
Note: the "ws" client requires epics2web to be running.
You can configure the URL to epics2web by copying the config/wsclient-default.properties to a new file named wsclient.properties and modifying the epics2web_monitor_url property. The default is localhost port 8080 at path /epics2web/monitor. The new properties file must be in the classpath, such as by keeping it in the config directory.
You can create a file named j8client.properties and include it in the config directory to control configuration of the J8Client. The options are described here. The defaults set in config/j8client-default.properties are to look for the CAServer on localhost only.
As a convenience to avoid having to set the system property -Dorg.epics.ca.impl.reactor.lf.LeaderFollowersThreadPool.thread_pool_size on the java command line that option will be honored if found in the properties file.
You can create a file named cajclient.properties and include it in the config directory to control configuration of the CAJClient. The defaults set in config/cajclient-default.properties are to look for the CAServer on localhost only.
- Stop the CAServer
gradlew stop