Giter VIP home page Giter VIP logo

Comments (12)

springleng avatar springleng commented on August 16, 2024 1

qq 20180116173304

应该是多出了一个换行符了,你不说我还真以为是类型的问题

from naruto.

springleng avatar springleng commented on August 16, 2024 1

而且还发现一个问题 --worker-num=1的时候 pa aux | grep php 查看是5个进程

from naruto.

TIGERB avatar TIGERB commented on August 16, 2024

完全可以啊~ 哈哈~

from naruto.

springleng avatar springleng commented on August 16, 2024

PHP7.1、7.2下报:
PHP Notice: A non well formed numeric value encountered in /vagrant_data/caipiao_api/naruto/src/Daemon.php on line 54

from naruto.

TIGERB avatar TIGERB commented on August 16, 2024

忘了说了 目前只在ubuntu&mac测试过 别的系统没测过,代码 是下面这样么?

public function check(Manager $manager)
	{
		if (! empty($manager->waitSignalProcessPool['signal'])) {
            return;
        }

        // get num now
		$num = shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l") - 3;
		
        // check num
        $diff = $manager->startNum - $num;
        if ($diff > 0) {
            // start worker
            $manager->execFork($diff);   
        }
	}

from naruto.

TIGERB avatar TIGERB commented on August 16, 2024

那块代码挺简单的 就是获取当前子进程的数量的shell 你可以debug下

from naruto.

springleng avatar springleng commented on August 16, 2024

类型转换一下就行了 $num = intval(shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l")) - 3;

from naruto.

TIGERB avatar TIGERB commented on August 16, 2024

哦哦,欢迎pr, thx~

不过奇了怪了,不是弱类型么,难道

shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l")

的结果是个非数字的字符串~

wc -l 应该是个数字啊~

from naruto.

springleng avatar springleng commented on August 16, 2024

PHP 7 慢慢的再往强类型靠

from naruto.

TIGERB avatar TIGERB commented on August 16, 2024

可以把你那边

shell_exec("pstree -p {$manager->master->pid} | grep php | wc -l")

的结果打印发我么 我看看~

thx~

from naruto.

TIGERB avatar TIGERB commented on August 16, 2024

嗯,换行符~

bug欢迎提交 pull request,哈哈~

from naruto.

TIGERB avatar TIGERB commented on August 16, 2024

[而且还发现一个问题 --worker-num=1的时候 pa aux | grep php 查看是5个进程]

已经fix了~

thx~

from naruto.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.