skywalking icon indicating copy to clipboard operation
skywalking copied to clipboard

skywalking will stop collect unexpectedly when hundreds os service

Open zxbu opened this issue 7 years ago • 16 comments

Please answer these questions before submitting your issue.

  • Why do you submit this issue?

  • [ ] Question or discussion

  • [x] Bug

  • [ ] Requirement

  • [ ] Feature or performance improvement

  • What happen? version: 6.0.0-GA config: only modify storage config for use elasticsearch, other config keep default. standalone mode

About 200 microservice instance, one standalone collector with memory 8g and cpu 8 cores. agent log GRPCStreamServiceStatus : Collector traceSegment service doesn't response in xxx seconds when running about one houres. And do not automatic recovery forerver. I hava to restart oapService, and it will be recovery. (我的英语不好,我用中文再说一遍。我用一个8核8G的机器运行oapService,大概有200个微服务上面有agent,但是每隔一小时左右,agent就不会再上传任何数据,oapService侧的日志没什么问题,agent的日志如下图所示。agent永远不会自动恢复,我必须手动重启一下oapService,agent才会恢复并正常上传,但过一小时左右又会这样,往复如此。)

this is the log:

image

zxbu avatar Apr 25 '19 07:04 zxbu

See ElasticSearch log, is the cluster alive?

wu-sheng avatar Apr 25 '19 07:04 wu-sheng

ElasticSearch is standalone mode. ElasticSearch was worked normally all the time. and the log do not have any error, only several gc info log

zxbu avatar Apr 25 '19 07:04 zxbu

This is es log: image

zxbu avatar Apr 25 '19 07:04 zxbu

If too many overheads, then the ElasticSearch may can't support the delete very well. Please add more nodes.

wu-sheng avatar Apr 25 '19 08:04 wu-sheng

image

the grpc-default-executor thread state all was TIMED_WAITING. Is it a endless loop sometimes? @wu-sheng

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package org.apache.skywalking.apm.commons.datacarrier.buffer;

import java.util.LinkedList;
import java.util.List;
import org.apache.skywalking.apm.commons.datacarrier.callback.QueueBlockingCallback;
import org.apache.skywalking.apm.commons.datacarrier.common.AtomicRangeInteger;

/**
 * Created by wusheng on 2016/10/25.
 */
public class Buffer<T> {
    private final Object[] buffer;
    private BufferStrategy strategy;
    private AtomicRangeInteger index;
    private List<QueueBlockingCallback<T>> callbacks;

    Buffer(int bufferSize, BufferStrategy strategy) {
        buffer = new Object[bufferSize];
        this.strategy = strategy;
        index = new AtomicRangeInteger(0, bufferSize);
        callbacks = new LinkedList<QueueBlockingCallback<T>>();
    }

    void setStrategy(BufferStrategy strategy) {
        this.strategy = strategy;
    }

    void addCallback(QueueBlockingCallback<T> callback) {
        callbacks.add(callback);
    }

    boolean save(T data) {
        int i = index.getAndIncrement();
        if (buffer[i] != null) {
            switch (strategy) {
                case BLOCKING:
                    boolean isFirstTimeBlocking = true;
                    while (buffer[i] != null) {
                        if (isFirstTimeBlocking) {
                            isFirstTimeBlocking = false;
                            for (QueueBlockingCallback<T> callback : callbacks) {
                                callback.notify(data);
                            }
                        }
                        try {
                            Thread.sleep(1L);
                        } catch (InterruptedException e) {
                        }
                    }
                    break;
                case IF_POSSIBLE:
                    return false;
                case OVERRIDE:
                default:
            }
        }
        buffer[i] = data;
        return true;
    }

    public int getBufferSize() {
        return buffer.length;
    }

    public LinkedList<T> obtain(int start, int end) {
        LinkedList<T> result = new LinkedList<T>();
        for (int i = start; i < end; i++) {
            if (buffer[i] != null) {
                result.add((T)buffer[i]);
                buffer[i] = null;
            }
        }
        return result;
    }

}

zxbu avatar Apr 25 '19 09:04 zxbu

the grpc-default-executor thread state all was TIMED_WAITING. Is it a endless loop sometimes? @wu-sheng

It needs to wait until the data has been consumed.

wu-sheng avatar Apr 25 '19 12:04 wu-sheng

6.2.0 We also have this issues....

WARN 2019-07-10 16:42:18:435 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 70955 seconds. WARN 2019-07-10 16:42:48:435 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 100955 seconds. WARN 2019-07-10 16:43:18:435 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 130955 seconds. WARN 2019-07-10 16:43:48:436 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 160955 seconds. WARN 2019-07-10 16:44:59:430 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 70955 seconds. WARN 2019-07-10 16:45:29:430 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 100955 seconds. WARN 2019-07-10 16:45:59:430 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 130955 seconds. WARN 2019-07-10 16:46:29:431 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 160955 seconds. WARN 2019-07-10 16:46:59:431 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 190955 seconds. WARN 2019-07-10 16:47:29:431 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 220955 seconds. WARN 2019-07-10 16:47:59:431 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 250955 seconds. WARN 2019-07-10 16:48:29:431 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 280955 seconds. WARN 2019-07-10 16:48:59:432 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 310955 seconds. WARN 2019-07-10 16:49:29:432 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 340955 seconds. WARN 2019-07-10 16:49:59:432 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 370955 seconds. WARN 2019-07-10 16:50:29:432 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 400955 seconds. WARN 2019-07-10 16:50:59:432 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 430955 seconds. WARN 2019-07-10 16:51:29:432 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 460955 seconds. WARN 2019-07-10 16:51:59:433 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 490955 seconds. WARN 2019-07-10 16:52:29:433 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 520955 seconds. WARN 2019-07-10 16:52:59:433 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 550955 seconds. WARN 2019-07-10 16:53:29:433 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 580955 seconds. WARN 2019-07-10 16:53:59:433 DataCarrier.DEFAULT.Consumser.0.Thread GRPCStreamServiceStatus : Collector traceSegment service doesn't response in 610955 seconds.

DerekHQ avatar Jul 10 '19 14:07 DerekHQ

Conclusion, this is not a skywalking bug. May be caused by your network, grpc are keeping retry. Due to this, we add timeout to current master and release from 6.3.0

But you need to remember, time our still cause trace data lost. Just send new trace without endless wait.

wu-sheng avatar Jul 10 '19 14:07 wu-sheng

I have the same problem,how to fix it?please help..

I have the same problem,how to fix it?please help..

I have replied. Please don't ask the same question without new information, because it isn't helpful.

wu-sheng avatar Aug 01 '19 02:08 wu-sheng

@wu-sheng 1.my skywalking agent log: image 2.my skywalking log: image 3.my skywalking web log: image 4.my elasticsearch log: image image 5.my skywalking ui: image

problem:my skywalking ui do not have any data.when I restart skywalking, the ui have data.but after few minutes,the data is disappear.all of the elasticsearch,skywalking,agent is Intranet,please help.

First thing I saw in your log, heartbeat id not existing, means you used to erase the storage, but agents don't restart.

wu-sheng avatar Aug 01 '19 03:08 wu-sheng

@wu-sheng I am do what you say .I am restart all agent. then I restart skywalking,after about 20 minutes,the problem show again. 1.the skywalking ui: image

2.the skywalking agent log: image

3.the skywalking log: image

4.the elasticsearch log: image image

please help.I give elasticsearch 8g memory,and give skywalking 2g memory.

Have you changed the ES config by following the FAQ?

wu-sheng avatar Aug 01 '19 05:08 wu-sheng

Thanks for your help. I change my elasticsearch config ,and it work normal now. image

@woshuowozhihuiduiniyiyinyiyi what version you use, my es is 7.x ,but cant set the thread_pool.index.queue_size

ihenjoy avatar Apr 13 '21 08:04 ihenjoy