fyzzy1943 最近的时间轴更新
fyzzy1943

fyzzy1943

V2EX 第 168371 号会员,加入于 2016-04-15 13:58:47 +08:00
fyzzy1943 最近回复了
2016-07-08 14:34:59 +08:00
回复了 fyzzy1943 创建的主题 NGINX 使用 nginx 和 sse 时候的并发问题
D:\www\php708nts\php-cgi.exe -b 127.0.0.1:9000-c D:\www\php708nts\php.ini 就像这样的,直接是打开的 php-cgi
2016-07-08 14:33:46 +08:00
回复了 fyzzy1943 创建的主题 NGINX 使用 nginx 和 sse 时候的并发问题
@sweb 我今天在找资料的时候发现 windows 似乎没有 fpm ,运行的话就是直接运行一个 php-cgi ,还没找到那个数量的设置,难道要多运行几个嘛?
2016-07-08 13:57:20 +08:00
回复了 lingxueyu 创建的主题 程序员 技能树点的有点乱,我该怎么办?
乱就乱吧 总有一些会慢慢忘了的 现在乱是因为哪个都舍不得丢了 不过其实也没必要主动丢
2016-07-08 13:53:54 +08:00
回复了 fyzzy1943 创建的主题 NGINX 使用 nginx 和 sse 时候的并发问题
```
server {
listen 80;
server_name 127.0.0.3;
root D:/www/www/SSE-learn/public;


location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
```

nginx 的配置是这样的,别的都是默认的,版本是 1.11.1

```
set_time_limit(0);

header('Content-Type: text/event-stream');
header('X-Accel-Buffering: no');
while(true) {
$sleepSecs = mt_rand(250, 500) / 1000.0;
usleep($sleepSecs * 1000000);

$bid = mt_rand(1000, 2000) / 1000.0;
$t = microtime(true);
$d = array(
'timestamp' => gmdate('Y-m-d H:i:s', $t) . sprintf('. %03d', ($t*1000)%1000),
'symbol' => 'funny',
'bid' => $bid,
);

echo 'data:' . json_encode($d) . PHP_EOL . PHP_EOL;
@ob_flush(); @flush();
```

PHP 代码大概是这样子的,然后想问下 windows 下运行 php-cgi ,是不是就是单进程模式运行的。
2016-07-08 10:17:03 +08:00
回复了 fyzzy1943 创建的主题 NGINX 使用 nginx 和 sse 时候的并发问题
@sweb 后端是 php 呀
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1772 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 00:26 · PVG 08:26 · LAX 17:26 · JFK 20:26
Developed with CodeLauncher
♥ Do have faith in what you're doing.