Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions frameworks/Java/aio-socket/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.github
.git
.DS_Store
docs
kubernetes
node_modules
/.svelte-kit
/package
.env
.env.*
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
__pycache__
.env
_old
uploads
.ipynb_checkpoints
**/*.db
_test
3 changes: 3 additions & 0 deletions frameworks/Java/aio-socket/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target/
logs
.settings
77 changes: 77 additions & 0 deletions frameworks/Java/aio-socket/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# t-io Benchmarking Test

This is the tio-server portion of a [benchmarking test suite](../) comparing a variety of web development platforms.

## Controller

These implementations use the tio-server's controller.

### Plaintext Test

* [Plaintext test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java)

### JSON Serialization Test

* [JSON test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java)


## Versions
3.7.3.v20231218-RELEASE (https://gitee.com/litongjava/t-io)

## Test URLs

All implementations use the same URLs.

### Plaintext Test

http://localhost:8080/plaintext

### JSON Encoding Test

http://localhost:8080/json



## Hot to run
### install mysql 8
- 1.please instal mysql 8.0.32,example cmd
```
docker run --restart=always -d --name mysql_8 --hostname mysql \
-p 3306:3306 \
-e 'MYSQL_ROOT_PASSWORD=robot_123456#' -e 'MYSQL_ROOT_HOST=%' -e 'MYSQL_DATABASE=hello_world' \
mysql/mysql-server:8.0.32 \
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --lower_case_table_names=1
```
- 2.create database schema hello_world
- 3.create tablle,[example](sql/hello_world.sql)
- 4.import data

### docker
```
docker build -t tio-server-benchmark -f tio-server.dockerfile .
```
The run is to specify the mysql database
```
docker run --rm -p 8080:8080 \
-e JDBC_URL="jdbc:mysql://192.168.3.9/hello_world" \
-e JDBC_USER="root" \
-e JDBC_PSWD="robot_123456#" \
tio-server-benchmark
```

### windows

-windows
```
D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar --JDBC_URL=jdbc:mysql://192.168.3.9/hello_world?useSSL=false --JDBC_USER=root --JDBC_PSWD=robot_123456#
```
or
```
set JDBC_URL=jdbc:mysql://192.168.3.9/hello_world
set jdbc.user=root
set JDBC_PSWD=robot_123456#
D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar
```



19 changes: 19 additions & 0 deletions frameworks/Java/aio-socket/aio-socket.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM litongjava/maven:3.8.8-jdk8u391 AS builder
WORKDIR /app

COPY pom.xml pom.xml
RUN mvn dependency:go-offline -q

COPY src src
RUN mvn package -Passembly -q
RUN ls -l && ls -l target

FROM litongjava/jre:8u391-stable-slim

WORKDIR /app

COPY --from=builder /app/target/aio-socket-benchmark-1.0-jar-with-dependencies.jar /app/aio-socket-benchmark-1.0.jar

EXPOSE 8080

CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC","-cp", "/app/aio-socket-benchmark-1.0.jar","com.litongjava.aio.http.server.HttpServer"]
23 changes: 23 additions & 0 deletions frameworks/Java/aio-socket/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"framework": "aio-socket",
"tests": [{
"default": {
"plaintext_url": "/plaintext",
"json_url": "/json",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"framework": "aio-socket",
"language": "Java",
"flavor": "None",
"orm": "Raw",
"platform": "t-io",
"webserver": "None",
"os": "Linux",
"database_os": "Linux",
"display_name": "aio-socket",
"notes": "aio-socket",
"versus": "t-io"
}
}]
}
15 changes: 15 additions & 0 deletions frameworks/Java/aio-socket/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[framework]
name = "t-io"

[main]
urls.plaintext = "/plaintext"
urls.json = "/json"
approach = "Realistic"
classification = "Micro"
database = "None"
database_os = "Linux"
os = "Linux"
orm = "Raw"
platform = "t-io"
webserver = "None"
versus = "t-io"
90 changes: 90 additions & 0 deletions frameworks/Java/aio-socket/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.litongjava</groupId>
<artifactId>aio-socket-benchmark</artifactId>
<version>1.0</version>
<name>${project.artifactId}</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<main.class>com.litongjava.aio.http.server.HttpServer</main.class>
</properties>
<dependencies>
<dependency>
<groupId>com.litongjava</groupId>
<artifactId>aio-socket</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.39</version>
</dependency>

</dependencies>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>

<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<debug>false</debug>
</configuration>
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading
Loading