Skip to content

Commit

Permalink
Merge pull request #3 from Informatievlaanderen/feat/binary-represent…
Browse files Browse the repository at this point in the history
…ation-testing

Feat/binary representation testing
  • Loading branch information
jobulcke authored Jan 3, 2024
2 parents 4be3bab + 28cd4c6 commit 359f3e2
Show file tree
Hide file tree
Showing 10 changed files with 416,878 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/server/tests/.java/
/server/tests/jmeter.log
/server/tests/results/
/*/tests/results/
/.idea/
/data/epsg/
/*/tests/.java/
/*/tests/jmeter.log
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Jmeter performance testing

- [LDES Server](/jmeter/server)
- [LDES Server](./server)
- Ensures that the server can handle significant load and its performance doesn't unknowingly degrade.
- [LDIO](/jmeter/ldio)
- [LDIO](./ldio)
- Not yet implemented
- [LDES Server + LDIO](/jmeter/ldio-with-server)
- Not yet implemented
- [LDES Server + LDIO](./ldio-with-server)
- Not yet implemented
- [Binary Representation (LDIO + LDES Server)](./binary-representations)
- Verifying whether binary data is faster parsed than string data
7 changes: 7 additions & 0 deletions binary-representations/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Windows
DISPLAY=host.docker.internal:0.0
X11=./tests/x11

# Unix
# DISPLAY=:0
# X11=/tmp/.X11-unix
11 changes: 11 additions & 0 deletions binary-representations/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu:latest
RUN useradd -ms /bin/bash jmeter
RUN apt-get update && apt-get install -y curl && apt-get clean
RUN curl https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.6.2.tgz --output apache-jmeter-5.6.2.tgz && tar -xf apache-jmeter-5.6.2.tgz && rm apache-jmeter-5.6.2.tgz && chown jmeter -R /apache-jmeter-5.6.2 && ln -s apache-jmeter-5.6.2 apache-jmeter
RUN apt-get install -y openjdk-19-jre && apt-get clean
RUN curl https://dlcdn.apache.org/jena/binaries/apache-jena-4.10.0.tar.gz --output apache-jena-4.10.0.tar.gz && tar -xf apache-jena-4.10.0.tar.gz && rm apache-jena-4.10.0.tar.gz && chown jmeter -R apache-jena-4.10.0 && ln -s apache-jena-4.10.0 apache-jena
RUN rm apache-jmeter/lib/mongo-java-driver-2*
RUN curl https://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/3.12.14/mongo-java-driver-3.12.14.jar --output apache-jmeter/lib/mongo-java-driver-3.12.14.jar
USER jmeter
WORKDIR /home/jmeter
ENTRYPOINT ["/apache-jmeter/bin/jmeter"]
109 changes: 109 additions & 0 deletions binary-representations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# LDES server RDF format performance testing

## Test Description

This test will test the performance of parsing RDF models via different RDF formats, especially binary data formats.

The test will send 10,000 members to ldi-orchestrator, the orchestrator will parse the member to the RDF format that is
set via an environment variable.

## Test Setup

> **Note**: if needed, copy the [environment file (.env)](./.env) to a personal file (e.g. `user.env`) and change the
> settings as needed. If you do, you need to add ` --env-file user.env` to each `docker compose` command.
> **_NOTE for Windows users:_**
>
Use [this tutorial](https://medium.com/@potatowagon/how-to-use-gui-apps-in-linux-docker-container-from-windows-host-485d3e1c64a3)
> to run JMeter in the docker-compose file.
> You can use DISPLAY=host.docker.internal:0.0 as environment variable to skip the ipconfig step.
# Steps:

Prerequisites:

- Pull the latest version of the server

```bash
docker pull ghcr.io/informatievlaanderen/ldes-server:latest
docker pull ghcr.io/informatievlaanderen/ldi-orchestrator:latest
```

1. Prepare directory that will contain the results
```bash
mkdir tests/results
chmod 777 tests/results
rm -rf tests/results/output
rm -rf tests/results/report.jtl
```

2. Start test

POST 100k members to LDIO via an RDF format of your choice
```bash
export CONTENT_TYPE=<RDF-FORMAT-OF-YOUR-CHOICE>
docker compose up
```

Some examples:
- POST 100k actual gipod members to LDIO via turtle
```bash
export CONTENT_TYPE=text/turtle
docker compose up
```

- POST 100k actual gipod members to LDIO via n-quads
```bash
export CONTENT_TYPE=application/n-quads
docker compose up
```

- POST 100k actual gipod members to LDIO via json-ld
```bash
export CONTENT_TYPE=application/ld+json
docker compose up
```

- POST 100k actual gipod members to LDIO via RDF Protobuf
```bash
export CONTENT_TYPE=application/rdf+protobuf
docker compose up
```

- POST 100k actual gipod members to LDIO via RDF Thrift
```bash
export CONTENT_TYPE=application/rdf+thrift
docker compose up
```

3. End test
```bash
docker compose down
```

4. Test results

To run the different tests, repeat step 1 -> 3 above and insert the results below.

- Test run: December 28, 2023
- Docker image
- ldes-server: ghcr.io/informatievlaanderen/ldes-server:20231228094401
- ldi-orchestrator: ghcr.io/informatievlaanderen/ldi-orchestrator:20231227095645
- Resources for both the orchestrator as server:
```yaml
deploy:
resources:
limits:
cpus: '4'
memory: '2GB'
reservations:
cpus: '2'
memory: '1GB'
```

| RDF Format | Members successfully posted | Average duration per member (ms) |
|--------------------------|-----------------------------|----------------------------------|
| text/turtle | 7,845 | 54.84 |
| application/n-quads | 8,685 | 48.55 |
| application/ld+json | 5,718 | 75.84 |
| application/rdf+protobuf | 9,906 | 39.64 |
| application/rdf+thrift | 8,887 | 47.35 |
25 changes: 25 additions & 0 deletions binary-representations/config/ldes-server.config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
mongock:
migration-scan-package: VSDS
springdoc:
swagger-ui:
path: /v1/swagger
management:
tracing:
enabled: false
endpoints:
web:
exposure:
include: prometheus,health
ldes-server:
host-name: http://localhost:8080
spring:
data:
mongodb:
database: bustang
host: ldes-mongodb
port: 27017
auto-index-creation: true # This index is SUPER important, fragmentation takes multiple times longer without.

logging:
level:
be.vlaanderen.informatievlaanderen.ldes.server.ingest: DEBUG
20 changes: 20 additions & 0 deletions binary-representations/config/ldio-workbench.config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
management:
tracing:
enabled: false
endpoints:
web:
exposure:
include: prometheus,health
orchestrator:
pipelines:
- name: gipod
input:
name: be.vlaanderen.informatievlaanderen.ldes.ldio.LdioHttpIn
adapter:
name: be.vlaanderen.informatievlaanderen.ldes.ldi.RdfAdapter
outputs:
- name: be.vlaanderen.informatievlaanderen.ldes.ldio.LdioHttpOut
config:
endpoint: http://ldes-server:8080/mobility-hindrances
rdf-writer:
content-type: ${CONTENT_TYPE}
71 changes: 71 additions & 0 deletions binary-representations/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: "3.3"

services:
jmeter:
container_name: jmeter_binary_jmeter
image: jmeter:latest
build: .
environment:
- DISPLAY=${DISPLAY}
volumes:
- ${X11}:/tmp/.X11-unix
- ./tests:/home/jmeter
command: -n -t binary_performance_testing.jmx -l results/report.jtl -e -o results/output/
depends_on:
ldes-server:
condition: service_healthy
ldio-workbench:
condition: service_healthy

ldio-workbench:
container_name: jmeter_binary_ldio_workbench
image: ghcr.io/informatievlaanderen/ldi-orchestrator:latest
volumes:
- ./config/ldio-workbench.config.yml:/ldio/application.yml:ro
environment:
- SIS_DATA=/tmp
- CONTENT_TYPE=${CONTENT_TYPE:-application/n-quads}
ports:
- "8081:8080"
healthcheck:
test: [ "CMD", "curl", "-f", "http://ldio-workbench:8080/actuator/health" ]
interval: 10s
timeout: 2s
retries: 10
deploy:
resources:
limits:
cpus: '4'
memory: '2GB'
reservations:
cpus: '2'
memory: '1GB'

ldes-server:
container_name: jmeter_binary_ldes-server
image: ghcr.io/informatievlaanderen/ldes-server:latest
volumes:
- ./config/ldes-server.config.yml:/application.yml:ro
- ../data/epsg:/tmp/Databases:rw
environment:
- SIS_DATA=/tmp
depends_on:
- ldes-mongodb
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://ldes-server:8080/actuator/health"]
deploy:
resources:
limits:
cpus: '4'
memory: '2GB'
reservations:
cpus: '2'
memory: '1GB'

ldes-mongodb:
container_name: jmeter_binary_ldes-mongodb
image: mongo:${MONGODB_TAG:-latest}
ports:
- ${MONGODB_PORT:-27017}:27017
Loading

0 comments on commit 359f3e2

Please sign in to comment.