V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  cs5117155  ›  全部回复第 1 页 / 共 2 页
回复总数  39
1  2  
7 天前
回复了 cs5117155 创建的主题 PHP 使用 workeman/redis 时,如何才能避免回调地狱
@zjsxwc 按照你不同的 promise 还真可以了,我有个好奇,你是怎么搜到 `https://sergeyzhuk.me/2017/06/16/phpreact-promises/` 。我找谷歌搜到都是官网文档的
9 天前
回复了 cs5117155 创建的主题 PHP 使用 workeman/redis 时,如何才能避免回调地狱
@zjsxwc
```php
$charecabinet_id =33;
$getDeferred = new React\Promise\Deferred();
$initialPromise = $getPromise =$deferred= $getDeferred->promise();


$initialPromise->then(function() use($redis,$initialPromise){

$redis->set('key2', 'value32', function ($result)use($initialPromise) {
$initialPromise->resolve($result);
});

return $initialPromise;
})->then(function($result)use($charecabinet_id,$initialPromise){
var_dump($charecabinet_id);
$row_count = self::$db->update('xxx')
->cols(array('heart_time'=>time()))
->where("ID=$charecabinet_id")->query();

return $initialPromise->resolve($row_count);
})->otherwise(function (\Throwable $x) {
// Propagate the rejection
echo 'Reject ' . $x->getMessage(); // 3
});
```
我参考你的写法,发现只运行到设置 key2=value32,第二个`then`没有运行下去了,是哪里姿势不对吗
@TomChaai 这个还真可以,一直找了半天
82 天前
回复了 cs5117155 创建的主题 PHP 实现一个简易的接口预警系统有什么好方式
@wellsc 这个觉得用起来比较复杂吧,维护成本大
120 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@fenglangjuxu
刚刚我用 ab 测试工具,日志里面只记录时间戳,发现最后一共有 5000 行时间戳,
file_put_contents($filename, $content, FILE_APPEND | LOCK_EX);
file_put_contents($filename, $content, FILE_APPEND);
得到的是相同的结果,并没有发现丢失日志的情况
$ ab -n 5000 -c 1000 https://www.test.com/ [13:51:25]
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.test.com (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software: nginx
Server Hostname: www.test.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Server Temp Key: X25519 253 bits
TLS Server Name: www.test.com

Document Path: /
Document Length: 0 bytes

Concurrency Level: 1000
Time taken for tests: 38.410 seconds
Complete requests: 5000
Failed requests: 0
Total transferred: 765000 bytes
HTML transferred: 0 bytes
Requests per second: 130.17 [#/sec] (mean)
Time per request: 7682.085 [ms] (mean)
Time per request: 7.682 [ms] (mean, across all concurrent requests)
Transfer rate: 19.45 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 18 3162 4908.2 1305 31784
Processing: 5 109 713.2 10 23984
Waiting: 5 104 707.6 10 23984
Total: 25 3271 4997.5 1406 38358

Percentage of the requests served within a certain time (ms)
50% 1406
66% 2480
75% 3593
80% 4551
90% 8914
95% 14342
98% 20763
99% 26161
100% 38358 (longest request)
121 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@fenglangjuxu 如果我用 postman 并发请求 1000 个,其实也可以达到这个效果吧
121 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@akira 阿里云的硬件资源指标监控我没有权限进去看,但我通过宝他提供云监控可视化看,负载平均都是在 10%左右,都很稳定的
121 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@wellsc
这样看写入的不多阿
[[email protected] ~]# iostat 2
Linux 3.10.0-1062.18.1.el7.x86_64 (iZwz9638raamc1mnqs77lgZ) 06/18/2021 _x86_64_ (2 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
1.70 0.00 1.13 2.52 0.00 94.65

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 38.77 1236.77 750.54 24477578143 14854213348

avg-cpu: %user %nice %system %iowait %steal %idle
1.75 0.00 1.00 2.00 0.00 95.25

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 29.85 0.00 274.63 0 552

avg-cpu: %user %nice %system %iowait %steal %idle
2.78 0.00 3.54 2.53 0.00 91.16

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 158.00 776.00 1616.00 1552 3232

avg-cpu: %user %nice %system %iowait %steal %idle
0.75 0.00 0.25 0.00 0.00 98.99

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 0.00 0.00 0.00 0 0

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.51 4.27 0.00 91.96

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 66.50 2.00 616.00 4 1232

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 1.01 3.28 0.00 94.19

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 76.00 4.00 698.00 8 1396

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.75 4.01 0.00 91.98

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 61.50 2.00 584.00 4 1168

avg-cpu: %user %nice %system %iowait %steal %idle
1.01 0.00 0.76 2.02 0.00 96.21

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 31.50 2.00 282.00 4 564

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.01 3.02 0.00 94.22

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 45.00 2.00 422.00 4 844

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 1.01 3.28 0.00 94.19

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 69.00 2.00 1878.00 4 3756

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 0.76 3.30 0.00 94.42

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 440.00 4 880

avg-cpu: %user %nice %system %iowait %steal %idle
1.50 0.00 0.75 1.50 0.00 96.24

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 24.00 0.00 216.00 0 432

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.26 3.53 0.00 93.45

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 50.50 2.00 462.00 4 924

avg-cpu: %user %nice %system %iowait %steal %idle
0.50 0.00 0.25 0.00 0.00 99.25

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 0.00 0.00 0.00 0 0

avg-cpu: %user %nice %system %iowait %steal %idle
1.51 0.00 1.01 3.27 0.00 94.22

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 63.00 2.00 1360.00 4 2720

avg-cpu: %user %nice %system %iowait %steal %idle
1.26 0.00 0.76 2.27 0.00 95.72

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 30.50 2.00 276.00 4 552

avg-cpu: %user %nice %system %iowait %steal %idle
2.02 0.00 1.01 3.27 0.00 93.70

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 436.00 4 872

avg-cpu: %user %nice %system %iowait %steal %idle
0.75 0.00 1.01 1.26 0.00 96.98

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 45.50 2.00 286.00 4 572

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.51 4.77 0.00 91.46

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 71.50 2.00 662.00 4 1324

avg-cpu: %user %nice %system %iowait %steal %idle
0.76 0.00 0.51 2.53 0.00 96.20

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 54.00 2.00 1508.00 4 3016

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 1.26 3.54 0.00 93.69

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 54.50 2.00 488.00 4 976

avg-cpu: %user %nice %system %iowait %steal %idle
20.80 0.00 2.51 7.77 0.00 68.92

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 63.50 4.00 16120.00 8 32240

avg-cpu: %user %nice %system %iowait %steal %idle
16.20 0.00 3.29 8.35 0.00 72.15

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 94.00 2.00 15182.00 4 30364

avg-cpu: %user %nice %system %iowait %steal %idle
1.50 0.00 1.00 2.01 0.00 95.49

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 30.50 2.00 268.00 4 536

avg-cpu: %user %nice %system %iowait %steal %idle
2.26 0.00 1.76 5.53 0.00 90.45

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 86.50 6.00 1698.00 12 3396

avg-cpu: %user %nice %system %iowait %steal %idle
1.01 0.00 0.75 1.51 0.00 96.73

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 25.00 2.00 238.00 4 476

avg-cpu: %user %nice %system %iowait %steal %idle
2.02 0.00 1.26 3.02 0.00 93.70

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 446.00 4 892

avg-cpu: %user %nice %system %iowait %steal %idle
1.00 0.00 0.50 0.50 0.00 97.99

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 6.00 0.00 60.00 0 120

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.51 4.27 0.00 92.46

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 60.50 2.00 544.00 4 1088

avg-cpu: %user %nice %system %iowait %steal %idle
1.26 0.00 0.75 1.76 0.00 96.23

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 45.50 2.00 1336.00 4 2672

avg-cpu: %user %nice %system %iowait %steal %idle
2.27 0.00 1.26 4.55 0.00 91.92

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 69.50 2.00 658.00 4 1316

avg-cpu: %user %nice %system %iowait %steal %idle
1.00 0.00 1.00 1.50 0.00 96.49

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 24.00 2.00 200.00 4 400

avg-cpu: %user %nice %system %iowait %steal %idle
2.53 0.00 3.54 2.53 0.00 91.41

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 63.00 2.00 464.00 4 928

avg-cpu: %user %nice %system %iowait %steal %idle
1.25 0.00 1.00 1.75 0.00 95.99

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 24.00 0.00 222.00 0 444

avg-cpu: %user %nice %system %iowait %steal %idle
2.02 0.00 0.76 3.78 0.00 93.45

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 72.00 2.00 1558.00 4 3116

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.26 2.51 0.00 94.47

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 42.50 2.00 390.00 4 780

avg-cpu: %user %nice %system %iowait %steal %idle
1.76 0.00 1.26 3.27 0.00 93.72

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda 48.50 2.00 448.00 4 896

avg-cpu: %user %nice %system %iowait %steal %idle
1.52 0.00 0.76 2.78 0.00 94.95
121 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@qq1340691923 这有点不实际阿,公司没有招 java 的
121 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@cbasil 我是看 thinkphp5 的文件日志驱动类
```php
protected function write($message, $destination, $apart = false)
{
//检测日志文件大小,超过配置大小则备份日志文件重新生成
if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) {
rename($destination, dirname($destination) . DS . time() . '-' . basename($destination));
$this->writed[$destination] = false;
}

if (empty($this->writed[$destination]) && !IS_CLI) {
if (App::$debug && !$apart) {
// 获取基本信息
if (isset($_SERVER['HTTP_HOST'])) {
$current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
} else {
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
}

$runtime = round(microtime(true) - THINK_START_TIME, 10);
$reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞';
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
$memory_str = ' [内存消耗:' . $memory_use . 'kb]';
$file_load = ' [文件加载:' . count(get_included_files()) . ']';

$message = '[ info ] ' . $current_uri . $time_str . $memory_str . $file_load . "\r\n" . $message;
}
$now = date($this->config['time_format']);
$server = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '0.0.0.0';
$remote = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'CLI';
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$message = "---------------------------------------------------------------\r\n[{$now}] {$server} {$remote} {$method} {$uri}\r\n" . $message;

$this->writed[$destination] = true;
}

if (IS_CLI) {
$now = date($this->config['time_format']);
$message = "[{$now}]" . $message;
}

return error_log($message, 3, $destination);
}

```
最后也是用 error_log 写入的,但是我就是 TP5 提供的 sql.log 日志,也漏某一个时刻的
121 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@iyaozhen
我添加一些详细的信息,服务器是 2 核心,4GB,40GB 硬盘。系统是 CentOS 7.7.1908,运行环境是宝塔,而且有一个 Mysql 表会不断更新硬件心跳,250 台机器左右,每 40s 会更新一次心跳。但平时用户比较少,只有晚上高峰期才会出现不同用户在同一时刻下单,而且现在用户才 2000 个,怎么也想不出这点用户,会在哪里情况下某时刻日志会丢的。
然后我通过 命令查看`pidstat -d 1`查看平时的 IO
```bash
# pidstat -d 1
Linux 3.10.0-1062.18.1.el7.x86_64 (iZwz9638raamc1mnqs77lgZ) 06/17/2021 _x86_64_ (2 CPU)

01:51:21 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:22 PM 0 332 0.00 3.96 0.00 jbd2/vda1-8
01:51:22 PM 1002 1528 0.00 47.52 0.00 redis-server
01:51:22 PM 1003 1878 3.96 122.77 79.21 mysqld
01:51:22 PM 1000 1920 0.00 3.96 0.00 nginx
01:51:22 PM 1000 2248 0.00 3.96 0.00 php-fpm
01:51:22 PM 1000 2253 0.00 3.96 0.00 php-fpm
01:51:22 PM 1000 31997 0.00 3.96 0.00 php-fpm

01:51:22 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:23 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:23 PM 1003 1878 0.00 72.00 48.00 mysqld
01:51:23 PM 1000 15198 0.00 4.00 0.00 php-fpm

01:51:23 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:24 PM 0 332 0.00 12.00 0.00 jbd2/vda1-8
01:51:24 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:24 PM 1003 1878 4.00 76.00 48.00 mysqld
01:51:24 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:24 PM 1000 15200 0.00 4.00 0.00 php-fpm
01:51:24 PM 1000 19628 0.00 8.00 0.00 php-fpm


01:51:25 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:26 PM 0 332 0.00 4.00 0.00 jbd2/vda1-8
01:51:26 PM 1002 1528 0.00 24.00 0.00 redis-server
01:51:26 PM 1003 1878 0.00 2140.00 32.00 mysqld
01:51:26 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:26 PM 1000 2254 0.00 4.00 0.00 php-fpm


01:51:30 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:31 PM 1002 1528 0.00 56.00 0.00 redis-server
01:51:31 PM 1003 1878 4.00 148.00 96.00 mysqld
01:51:31 PM 1000 2250 0.00 4.00 0.00 php-fpm
01:51:31 PM 1000 15703 0.00 4.00 0.00 php-fpm

01:51:33 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command

01:51:34 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:35 PM 0 332 0.00 88.00 0.00 jbd2/vda1-8
01:51:35 PM 1002 1528 0.00 48.00 0.00 redis-server
01:51:35 PM 1003 1878 4.00 128.00 80.00 mysqld
01:51:35 PM 1000 1920 0.00 4.00 0.00 nginx
01:51:35 PM 1000 1921 0.00 8.00 0.00 nginx
01:51:35 PM 1000 2249 0.00 4.00 0.00 php-fpm
01:51:35 PM 1000 2251 0.00 4.00 0.00 php-fpm
01:51:35 PM 1000 2254 0.00 4.00 0.00 php-fpm

01:51:35 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:36 PM 1002 1528 0.00 104.00 0.00 redis-server
01:51:36 PM 1003 1878 4.00 2452.00 176.00 mysqld
01:51:36 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:36 PM 1000 2253 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 14284 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 15200 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 15209 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 19628 0.00 4.00 0.00 php-fpm
01:51:36 PM 1000 19629 0.00 4.00 0.00 php-fpm

01:51:36 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:37 PM 1002 1528 0.00 40.00 0.00 redis-server
01:51:37 PM 1003 1878 4.00 100.00 64.00 mysqld
01:51:37 PM 1000 16440 0.00 4.00 0.00 php-fpm
01:51:37 PM 1000 19627 0.00 4.00 0.00 php-fpm

01:51:37 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:38 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:38 PM 1003 1878 0.00 72.00 48.00 mysqld
01:51:38 PM 1000 31997 0.00 8.00 0.00 php-fpm

01:51:38 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:39 PM 1002 1528 0.00 20.00 0.00 redis-server
01:51:39 PM 1003 1878 4.00 52.00 32.00 mysqld
01:51:39 PM 0 1995 0.00 4.00 0.00 BT-Panel
01:51:39 PM 1000 15332 0.00 4.00 0.00 php-fpm

01:51:39 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:40 PM 1002 1528 0.00 24.00 0.00 redis-server
01:51:40 PM 1003 1878 0.00 72.00 48.00 mysqld
01:51:40 PM 1000 2248 0.00 4.00 0.00 php-fpm

01:51:42 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:43 PM 1002 1528 0.00 28.00 0.00 redis-server
01:51:43 PM 1003 1878 0.00 76.00 48.00 mysqld
01:51:43 PM 1000 2247 0.00 4.00 0.00 php-fpm
01:51:43 PM 1000 19629 0.00 4.00 0.00 php-fpm

01:51:43 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:44 PM 1002 1528 0.00 108.00 0.00 redis-server
01:51:44 PM 1003 1878 8.00 296.00 192.00 mysqld
01:51:44 PM 1000 1921 0.00 4.00 0.00 nginx
01:51:44 PM 1000 2253 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 2254 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 14284 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 14285 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 15199 0.00 4.00 0.00 php-fpm
01:51:44 PM 1000 15332 0.00 4.00 0.00 php-fpm

01:51:44 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:45 PM 0 1995 0.00 4.00 0.00 BT-Panel

01:51:45 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:46 PM 0 332 0.00 8.00 0.00 jbd2/vda1-8
01:51:46 PM 1002 1528 0.00 20.00 0.00 redis-server
01:51:46 PM 1003 1878 0.00 2332.00 32.00 mysqld
01:51:46 PM 1000 2250 0.00 4.00 0.00 php-fpm
01:51:46 PM 1000 15198 0.00 4.00 0.00 php-fpm

01:51:46 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:47 PM 1002 1528 0.00 20.00 0.00 redis-server
01:51:47 PM 1003 1878 4.00 52.00 32.00 mysqld
01:51:47 PM 1000 15703 0.00 4.00 0.00 php-fpm

01:51:47 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:48 PM 1002 1528 0.00 56.00 0.00 redis-server
01:51:48 PM 1003 1878 4.00 148.00 96.00 mysqld
01:51:48 PM 1000 2249 0.00 4.00 0.00 php-fpm
01:51:48 PM 1000 15199 0.00 4.00 0.00 php-fpm
01:51:48 PM 1000 19628 0.00 4.00 0.00 php-fpm

01:51:48 PM UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
01:51:49 PM 1002 1528 0.00 12.00 0.00 redis-server
01:51:49 PM 1003 1878 0.00 24.00 16.00 mysqld
01:51:49 PM 1000 2251 0.00 4.00 0.00 php-fpm
```
122 天前
回复了 cs5117155 创建的主题 PHP PHP 高并发日志丢失问题
@l4ever 那这个 io,我需要怎么测试才知道最大处理是多少 mb 的
133 天前
回复了 cs5117155 创建的主题 PHP 使用 openssl_verify 签名校验 SHA256withRSA 的问题
@thunderw 果然厉害,之前我一直都是用 Paypal-Cert-Url,Paypal-Auth-Algo,Paypal-Transmission-Id 这样的关键词搜索,还真无想到用你那个关键词搜 😄
133 天前
回复了 cs5117155 创建的主题 PHP 使用 openssl_verify 签名校验 SHA256withRSA 的问题
@rockyliang 这个每次收到异步请求,都要再 post 请求一次,我怕会担心资源消耗
133 天前
回复了 cs5117155 创建的主题 PHP 使用 openssl_verify 签名校验 SHA256withRSA 的问题
@thunderw 果然是要 base64_decode($signature),webhook ID 是后台配置固定的那个。而且我也很佩服你搜什么关键字找到这个 https://www.bahjeez.com/validating-paypal-webhooks-offline-almost/ 连接,我谷歌一上午找不到合适的答案
@nulIptr 我查询出来的时候,已经按层级顺序展示出来了,保证根节点的孩子节点之和不大于 100,这个改动代码有些多,所以想换一个方式
159 天前
回复了 cs5117155 创建的主题 程序员 二进制数据累加求和,取低八位
谢谢大家,原来我自已程序过滤了一个字节,导致结果错误了,2631 是对的
加 qq 了
@zhuzhibin 问题是我不能修改它的源码
@deargodfrey 这个也不错
1  2  
关于   ·   帮助文档   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2009 人在线   最高记录 5497   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 36ms · UTC 04:03 · PVG 12:03 · LAX 21:03 · JFK 00:03
♥ Do have faith in what you're doing.