Giter VIP home page Giter VIP logo

Comments (7)

Yurunsoft avatar Yurunsoft commented on July 18, 2024

请描述问题,光贴日志看不懂

from tdengine-restful-connector.

onlyshow avatar onlyshow commented on July 18, 2024
        $i = 0;
        while (true) {
            if ($i >= 2000) {
                break;
            }
            foreach ($node_log_groups as $node_log_group) {
                $i ++;
                $node_id = $node_log_group['node_id'];

                go(function () use ($node_id, $start_time, $end_time) {
                    $service = new CreateAlert2($node_id, $start_time, $end_time);
                    $service->handle();
                });
            }
        }
class CreateAlert2
{
    public string|int $node_id;
    public string|int $start_time;
    public string|int $end_time;

    public function __construct($node_id, $start_time, $end_time)
    {
        $this->node_id = $node_id;
        $this->start_time = $start_time;
        $this->end_time = $end_time;
    }

    public function handle(): void
    {
        $sql = "select ts, current from node.log where ts >= '{$this->start_time}' and ts < '{$this->end_time}' and node_id = {$this->node_id}";
        $node_log_list = TDEngineOrm::getClientHandler()->query($sql)->getData();
    }
}

一次并发2000个协程请求,就会出现这个问题 @Yurunsoft

from tdengine-restful-connector.

onlyshow avatar onlyshow commented on July 18, 2024
    /**
     * @param \Yurun\Util\YurunHttp\Pool\Config\PoolConfig $config
     */
    public function __construct($config)
    {
        parent::__construct($config);
        $this->channel = new Channel(1024);
    }

是因为这里限制了1024,所以最大只能并发1024个么

from tdengine-restful-connector.

Yurunsoft avatar Yurunsoft commented on July 18, 2024

试试连接配置的 keepAlive 设为 false

from tdengine-restful-connector.

Yurunsoft avatar Yurunsoft commented on July 18, 2024

发了个 v1.0.4 版本,问题解决,不用修改配置了

from tdengine-restful-connector.

onlyshow avatar onlyshow commented on July 18, 2024

发了个 v1.0.4 版本,问题解决,不用修改配置了

好的,我去试试

from tdengine-restful-connector.

onlyshow avatar onlyshow commented on July 18, 2024

没有问题了

from tdengine-restful-connector.

Related Issues (7)

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.