Skip to content

Commit 7286bd0

Browse files
Ilya NemtsevIlya Nemtsev
authored andcommitted
added r2dbc
1 parent 6d5e760 commit 7286bd0

File tree

18 files changed

+573
-7
lines changed

18 files changed

+573
-7
lines changed

frameworks/Kotlin/ktor/benchmark_config.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,29 @@
2525
"notes": "http://ktor.io/",
2626
"versus": "netty"
2727
},
28+
"r2dbc": {
29+
"plaintext_url": "/plaintext",
30+
"json_url": "/json",
31+
"db_url": "/db",
32+
"query_url": "/queries?queries=",
33+
"update_url": "/updates?queries=",
34+
"fortune_url": "/fortunes",
35+
36+
"port": 9090,
37+
"approach": "Realistic",
38+
"classification": "Micro",
39+
"database": "Postgres",
40+
"framework": "ktor",
41+
"language": "Kotlin",
42+
"orm": "Raw",
43+
"platform": "Netty",
44+
"webserver": "None",
45+
"os": "Linux",
46+
"database_os": "Linux",
47+
"display_name": "ktor-netty-r2dbc",
48+
"notes": "http://ktor.io/",
49+
"versus": "netty"
50+
},
2851
"jetty": {
2952
"plaintext_url": "/plaintext",
3053
"json_url": "/json",

frameworks/Kotlin/ktor/ktor-exposed/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repositories {
99
mavenCentral()
1010
}
1111

12-
val ktorVersion = "3.0.1"
12+
val ktorVersion = "3.0.3"
1313
val kotlinxSerializationVersion = "1.7.3"
1414
val exposedVersion = "0.56.0"
1515

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM maven:3.9.9-amazoncorretto-21-debian-bookworm as maven
2+
WORKDIR /ktor
3+
COPY ktor/pom.xml pom.xml
4+
COPY ktor/src src
5+
RUN mvn clean package -q
6+
7+
FROM amazoncorretto:21-al2023-headless
8+
WORKDIR /ktor
9+
COPY --from=maven /ktor/target/tech-empower-framework-benchmark-1.0-SNAPSHOT-netty-bundle.jar app.jar
10+
11+
EXPOSE 9090
12+
13+
CMD ["java", "-server","-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AlwaysPreTouch", "-jar", "app.jar"]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Ktor
2+
3+
Ktor is a framework for building servers and clients in connected systems using Kotlin programming language.
4+
More information is available at [ktor.io](http://ktor.io).
5+
6+
# Setup
7+
8+
* Java 21
9+
* Postgres server
10+
11+
# Requirements
12+
13+
* Maven 3
14+
* JDK 21
15+
* Kotlin
16+
* ktor
17+
* netty
18+
* R2DBC
19+
20+
Maven is downloaded automatically via Maven Wrapper script (`mvnw`), add dependencies are specified in `pom.xml` so will be downloaded automatically from maven central and jcenter repositories.
21+
22+
# Deployment
23+
24+
Run maven to build a bundle
25+
26+
```bash
27+
./mvnw package
28+
```
29+
30+
Once bundle build complete and mysql server is running you can launch the application
31+
32+
```bash
33+
java -jar target/tech-empower-framework-benchmark-1.0-SNAPSHOT.jar
34+
```
35+
36+
Please note that the server holds tty so you may need nohup. See `setup.sh` for details.
37+
38+
# Contact
39+
40+
[Leonid Stashevsky](https://github.com/e5l)
41+
42+
[Sergey Mashkov](https://github.com/cy6erGn0m)
43+
44+
[Ilya Ryzhenkov](https://github.com/orangy)
45+
46+
[Ilya Nemtsev](https://github.com/inemtsev)
47+
48+
Slack ktor channel https://kotlinlang.slack.com/messages/ktor (you need an [invite](http://slack.kotlinlang.org/) to join)
49+
50+
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.jetbrains.ktor</groupId>
8+
<artifactId>tech-empower-framework-benchmark</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<packaging>jar</packaging>
11+
12+
<name>org.jetbrains.ktor tech-empower-framework-benchmark</name>
13+
14+
<properties>
15+
<kotlin.version>2.0.21</kotlin.version>
16+
<kotlin.coroutines.version>1.10.1</kotlin.coroutines.version>
17+
<ktor.version>3.0.3</ktor.version>
18+
<serialization.version>1.7.3</serialization.version>
19+
<kotlinx.html.version>0.11.0</kotlinx.html.version>
20+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21+
<logback.version>1.2.13</logback.version>
22+
<postgresql.version>42.7.4</postgresql.version>
23+
<r2dbc.version>1.0.7.RELEASE</r2dbc.version>
24+
</properties>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>org.jetbrains.kotlin</groupId>
29+
<artifactId>kotlin-reflect</artifactId>
30+
<version>${kotlin.version}</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.jetbrains.kotlinx</groupId>
34+
<artifactId>kotlinx-serialization-core</artifactId>
35+
<version>${serialization.version}</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.jetbrains.kotlinx</groupId>
39+
<artifactId>kotlinx-serialization-json</artifactId>
40+
<version>${serialization.version}</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.jetbrains.kotlinx</groupId>
44+
<artifactId>kotlinx-html-jvm</artifactId>
45+
<version>${kotlinx.html.version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.jetbrains.kotlinx</groupId>
49+
<artifactId>kotlinx-coroutines-core</artifactId>
50+
<version>${kotlin.coroutines.version}</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.jetbrains.kotlinx</groupId>
54+
<artifactId>kotlinx-coroutines-reactor</artifactId>
55+
<version>${kotlin.coroutines.version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>io.ktor</groupId>
59+
<artifactId>ktor-server-default-headers-jvm</artifactId>
60+
<version>${ktor.version}</version>
61+
</dependency>
62+
<dependency>
63+
<groupId>io.ktor</groupId>
64+
<artifactId>ktor-server-html-builder-jvm</artifactId>
65+
<version>${ktor.version}</version>
66+
</dependency>
67+
68+
<dependency>
69+
<groupId>org.postgresql</groupId>
70+
<artifactId>r2dbc-postgresql</artifactId>
71+
<version>${r2dbc.version}</version>
72+
</dependency>
73+
74+
<dependency>
75+
<groupId>ch.qos.logback</groupId>
76+
<artifactId>logback-classic</artifactId>
77+
<version>${logback.version}</version>
78+
</dependency>
79+
<dependency>
80+
<groupId>io.ktor</groupId>
81+
<artifactId>ktor-server-netty-jvm</artifactId>
82+
<version>${ktor.version}</version>
83+
</dependency>
84+
</dependencies>
85+
86+
<build>
87+
<sourceDirectory>src/main/kotlin</sourceDirectory>
88+
89+
<plugins>
90+
<plugin>
91+
<groupId>org.jetbrains.kotlin</groupId>
92+
<artifactId>kotlin-maven-plugin</artifactId>
93+
<version>${kotlin.version}</version>
94+
<executions>
95+
<execution>
96+
<id>compile</id>
97+
<phase>compile</phase>
98+
<goals>
99+
<goal>compile</goal>
100+
</goals>
101+
</execution>
102+
<execution>
103+
<id>test-compile</id>
104+
<phase>test-compile</phase>
105+
<goals>
106+
<goal>test-compile</goal>
107+
</goals>
108+
</execution>
109+
</executions>
110+
<configuration>
111+
<compilerPlugins>
112+
<plugin>kotlinx-serialization</plugin>
113+
</compilerPlugins>
114+
</configuration>
115+
<dependencies>
116+
<dependency>
117+
<groupId>org.jetbrains.kotlin</groupId>
118+
<artifactId>kotlin-maven-serialization</artifactId>
119+
<version>${kotlin.version}</version>
120+
</dependency>
121+
</dependencies>
122+
</plugin>
123+
<plugin>
124+
<artifactId>maven-jar-plugin</artifactId>
125+
<configuration>
126+
<skip>true</skip>
127+
</configuration>
128+
<executions>
129+
<execution>
130+
<id>default-jar</id>
131+
<phase>none</phase>
132+
</execution>
133+
</executions>
134+
</plugin>
135+
<plugin>
136+
<artifactId>maven-assembly-plugin</artifactId>
137+
<version>3.0.0</version>
138+
139+
<executions>
140+
<execution>
141+
<id>netty</id>
142+
<goals>
143+
<goal>single</goal>
144+
</goals>
145+
146+
<phase>package</phase>
147+
148+
<configuration>
149+
<descriptors>
150+
<descriptor>src/main/assembly/netty-bundle.xml</descriptor>
151+
</descriptors>
152+
<archive>
153+
<manifest>
154+
<mainClass>io.ktor.server.netty.EngineMain</mainClass>
155+
</manifest>
156+
</archive>
157+
</configuration>
158+
</execution>
159+
</executions>
160+
</plugin>
161+
</plugins>
162+
</build>
163+
</project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
3+
<id>cio-bundle</id>
4+
<formats>
5+
<format>jar</format>
6+
</formats>
7+
8+
<includeBaseDirectory>false</includeBaseDirectory>
9+
10+
<dependencySets>
11+
<dependencySet>
12+
<unpack>true</unpack>
13+
<scope>runtime</scope>
14+
15+
<useTransitiveDependencies>true</useTransitiveDependencies>
16+
17+
<excludes>
18+
<exclude>*:ktor-server-netty</exclude>
19+
<exclude>*:ktor-server-jetty</exclude>
20+
</excludes>
21+
</dependencySet>
22+
</dependencySets>
23+
24+
<fileSets>
25+
<fileSet>
26+
<directory>${project.build.outputDirectory}</directory>
27+
<outputDirectory>/</outputDirectory>
28+
</fileSet>
29+
</fileSets>
30+
</assembly>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
3+
<id>jetty-bundle</id>
4+
<formats>
5+
<format>jar</format>
6+
</formats>
7+
8+
<includeBaseDirectory>false</includeBaseDirectory>
9+
10+
<dependencySets>
11+
<dependencySet>
12+
<unpack>true</unpack>
13+
<scope>runtime</scope>
14+
15+
<useTransitiveDependencies>true</useTransitiveDependencies>
16+
17+
<excludes>
18+
<exclude>*:ktor-server-netty</exclude>
19+
<exclude>*:ktor-server-cio</exclude>
20+
</excludes>
21+
</dependencySet>
22+
</dependencySets>
23+
24+
<fileSets>
25+
<fileSet>
26+
<directory>${project.build.outputDirectory}</directory>
27+
<outputDirectory>/</outputDirectory>
28+
</fileSet>
29+
</fileSets>
30+
</assembly>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
3+
<id>netty-bundle</id>
4+
5+
<formats>
6+
<format>jar</format>
7+
</formats>
8+
9+
<includeBaseDirectory>false</includeBaseDirectory>
10+
11+
<dependencySets>
12+
<dependencySet>
13+
<unpack>true</unpack>
14+
<scope>runtime</scope>
15+
16+
<excludes>
17+
<exclude>*:ktor-server-jetty</exclude>
18+
<exclude>*:ktor-server-cio</exclude>
19+
</excludes>
20+
</dependencySet>
21+
</dependencySets>
22+
23+
<fileSets>
24+
<fileSet>
25+
<directory>${project.build.outputDirectory}</directory>
26+
<outputDirectory>/</outputDirectory>
27+
</fileSet>
28+
</fileSets>
29+
</assembly>

0 commit comments

Comments
 (0)