Skip to content

Commit 8745f67

Browse files
authored
add disable coroutine case (#6818)
* Update IndexController.php * add disable coroutine case * name * c name * font
1 parent add2686 commit 8745f67

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
* swoole 运行这个文件
4+
* php swoole.php
5+
*/
6+
define('_APP_PATH_', __DIR__);
7+
8+
define('_APP_PATH_VIEW_', __DIR__ . '/View');
9+
10+
//define('_DEBUG_',true);
11+
12+
require __DIR__ . '/../vendor/autoload.php';
13+
require __DIR__ . '/../vendor/lizhichao/one/src/run.php';
14+
require __DIR__ . '/config.php';
15+
16+
17+
\One\Swoole\OneServer::parseArgv();
18+
19+
//\Swoole\Runtime::enableCoroutine();
20+
21+
\One\Swoole\OneServer::runAll();
22+
23+
24+

frameworks/PHP/one/benchmark_config.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,29 @@
2424
"display_name": "one",
2525
"notes": "",
2626
"versus": "swoole"
27+
},
28+
"no-coroutine": {
29+
"json_url": "/json",
30+
"plaintext_url": "/plaintext",
31+
"db_url": "/db",
32+
"fortune_url": "/fortunes",
33+
"update_url": "/updates/",
34+
"query_url": "/queries/",
35+
"port": 8080,
36+
"approach": "Realistic",
37+
"classification": "Fullstack",
38+
"database": "MySQL",
39+
"framework": "one",
40+
"language": "PHP",
41+
"flavor": "None",
42+
"orm": "Full",
43+
"platform": "swoole",
44+
"webserver": "None",
45+
"os": "Linux",
46+
"database_os": "Linux",
47+
"display_name": "one-no-coroutine",
48+
"notes": "",
49+
"versus": "swoole"
2750
}
2851
}
2952
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM php:8.0-cli
2+
3+
RUN pecl install swoole > /dev/null && \
4+
docker-php-ext-enable swoole
5+
6+
RUN docker-php-ext-install opcache pdo_mysql bcmath > /dev/null
7+
8+
RUN apt -yqq update > /dev/null && \
9+
apt -yqq install git unzip > /dev/null
10+
11+
COPY . /one
12+
COPY php.ini /usr/local/etc/php/
13+
RUN echo "opcache.enable=1" >> /usr/local/etc/php/php.ini
14+
RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/php.ini
15+
RUN echo "pcre.jit=1" >> /usr/local/etc/php/php.ini
16+
RUN echo "opcache.jit=1205" >> /usr/local/etc/php/php.ini
17+
RUN echo "opcache.jit_buffer_size=256M" >> /usr/local/etc/php/php.ini
18+
19+
RUN php -v && php -i | grep opcache
20+
21+
WORKDIR /one
22+
23+
RUN curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
24+
RUN composer install --no-dev --classmap-authoritative --quiet > /dev/null
25+
RUN composer dumpautoload -o
26+
27+
RUN mkdir -p /one/App/RunCache
28+
RUN chmod -R 777 /one/App/RunCache
29+
30+
EXPOSE 8080
31+
32+
CMD php App/swoole_disable_coroutine.php

0 commit comments

Comments
 (0)