netpoll | performance non-blocking I/O networking framework

 by   cloudwego Go Version: v0.3.2 License: Apache-2.0

kandi X-RAY | netpoll Summary

kandi X-RAY | netpoll Summary

netpoll is a Go library typically used in Web Services applications. netpoll has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Netpoll is a high-performance non-blocking I/O networking framework, which focused on RPC scenarios, developed by ByteDance. RPC is usually heavy on processing logic and therefore cannot handle I/O serially. But Go's standard library net is designed for blocking I/O APIs, so that the RPC framework can only follow the One Conn One Goroutine design. It will waste a lot of cost for context switching, due to a large number of goroutines under high concurrency. Besides, net.Conn has no API to check Alive, so it is difficult to make an efficient connection pool for RPC framework, because there may be a large number of failed connections in the pool. On the other hand, the open source community currently lacks Go network libraries that focus on RPC scenarios. Similar repositories such as: evio, gnet, etc., are all focus on scenarios like Redis, HAProxy. But now, Netpoll was born and solved the above problems. It draws inspiration from the design of evio and netty, has excellent Performance, and is more suitable for microservice architecture. Also Netpoll provides a number of Features, and it is recommended to replace net in some RPC scenarios. We developed the RPC framework Kitex and HTTP framework Hertz (coming soon) based on Netpoll, both with industry-leading performance. Examples show how to build RPC client and server using Netpoll. For more information, please refer to Document.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              netpoll has a medium active ecosystem.
              It has 3561 star(s) with 390 fork(s). There are 73 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 20 open issues and 80 have been closed. On average issues are closed in 122 days. There are 18 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of netpoll is v0.3.2

            kandi-Quality Quality

              netpoll has no bugs reported.

            kandi-Security Security

              netpoll has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              netpoll is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              netpoll releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of netpoll
            Get all kandi verified functions for this library.

            netpoll Key Features

            No Key Features are available at this moment for netpoll.

            netpoll Examples and Code Snippets

            No Code Snippets are available at this moment for netpoll.

            Community Discussions

            QUESTION

            AWS S3 downloader out of memory
            Asked 2021-Mar-31 at 10:19

            I'm having a problem downloading large files from an AWS S3 bucket using the golang client, I'm not an expert with golang so I would appreciate any help.

            I'm creating a simple API that expose an endpoint using gin-gonic framework, when someone sends a request to that endpoint the app download a huge CSV file from an AWS S3 bucket and save the contents of the file in a local DB.

            When the file size is 200 mb it works correctly but with bigger files, say 500 mb, I start getting out of memory errors.

            I'm using this portion of code to create the session and donwload the file:

            ...

            ANSWER

            Answered 2021-Mar-31 at 10:19

            By using the downloader you are unable to process the file while it is downloading: it downloads different chunks concurrently so you do not receive the bytes in order.

            If you want to process the bytes as you download them, you can try using s3.S3 instead. This downloads the object in order, but only uses a single goroutine so will be slower.

            Something like:

            Source https://stackoverflow.com/questions/66874300

            QUESTION

            Terratest does not find terraform on Mac
            Asked 2020-Mar-24 at 18:46

            I am trying to write a simple go test as follows

            ...

            ANSWER

            Answered 2020-Mar-24 at 08:09

            TerraformDir option should be set to a folder path and not a file path.

            Source https://stackoverflow.com/questions/60790832

            QUESTION

            Out of memory when downloading 460mb file from S3 to AWS lambda using go aws sdk
            Asked 2020-Jan-24 at 21:53

            I'm running lambda using the aws-sdk-go-v2 but running into memory issues when downloading larger files. I've tried all sorts of combinations of partSize and concurrency but I either hit the timeout when setting concurrency to a small number or hit an out of memory issue.

            Does anyone know how to fix this or a better or other way of downloading files from S3 using go?

            ...

            ANSWER

            Answered 2020-Jan-24 at 21:53

            Try to set slice len/cap:

            Source https://stackoverflow.com/questions/59892905

            QUESTION

            Why is threads usage getting increased with Network IO in golang?
            Asked 2018-Dec-31 at 14:34

            I had created a test program to check my understanding of how Golang handles Network IO. The below program creates 1000 goroutines and in each goroutine, it will make a Network IO request.

            When I tried to monitor the number of threads getting used, it goes up to 400 Threads. I had used the top command to monitor, My understanding is for network io Golang uses netpoll(i.e async io).

            Please correct me if my understanding is wrong.

            OS: macos high sierra

            Go version: go1.11.2 darwin/amd64

            ...

            ANSWER

            Answered 2018-Dec-31 at 14:34

            When a thread is blocked on a system IO call, Go may create a new thread to allow other goroutines to continue to run. This has a good explanation: https://povilasv.me/go-scheduler/:

            Interesting things happen when your goroutine makes a blocking syscall. Blocking syscall will be intercepted, if there are Gs to run, runtime will detach the thread from the P and create a new OS thread (if idle thread doesn’t exist) to service that processor.

            So, instead of having a handful of threads and utilizing 0% of your CPU because all the threads are tied up waiting on a blocking syscall to return, instead it sets those threads aside and spins up new threads so non-blocked goroutines can do their work while it waits for the blocking syscall(s) to return.

            Source https://stackoverflow.com/questions/53983656

            QUESTION

            Golang channels getting stuck
            Asked 2018-Jul-24 at 19:52

            I am working with go and redis to dispatch a queue (channel) of messages to subscribers. I am aiming to create an auto scaling solution that will spawn new go routines (within a certain limit) as the queue gets larger. I have the below code:

            ...

            ANSWER

            Answered 2018-May-04 at 10:59

            Based on this

            I can see from other testing I'm running that this isn't just going slowly and that the messages just aren't being taken from the channel.

            I think you have a live lock in addRedisSender()

            The select statement will pseudo randomly select one of the cases, either the killSwitch case, or the <-messageChannel. Except there's also another case, the default. This will always be true, meaning the for { loop will spin for ever consuming all the resources and causing a live lock as the go runtime tries to schedule more and more competing go routines.

            If you remove the default: continue case then the for loop will block on the select until there's a message to read, or a kill signal.

            Source https://stackoverflow.com/questions/50129226

            QUESTION

            Docker for Mac `docker images` command returns "fatal error: fault"
            Asked 2018-Jun-20 at 23:47

            After pulling an image from docker hub docker images list won't list the image and i receive a fatal error: fault on docker images command

            ...

            ANSWER

            Answered 2018-Jun-20 at 23:47

            The issue is it conflicted with an old docker installed via brew. That's why there's a lot of mention of "Cellar" in the output. Once i uninstalled the brew version of docker the commands worked and the images listed as expected.

            Source https://stackoverflow.com/questions/50958166

            QUESTION

            Linux - Sending packets from inside the kernel
            Asked 2017-Oct-17 at 09:44


            I'm need to create a loadable kernel module which sends data to another remote computer.
            I'm writing to 4.10 kernel.
            I tried the netpoll API but all I got was errors and I can't find any new and up-do-date information about socket programming inside the kernel.
            can anyone give my an example (or any directions) to it?

            ...

            ANSWER

            Answered 2017-Oct-17 at 09:44

            As I tried to find the solution by using netpoll, I found that using socket might be more useful. I found this link of a github repository that have exactly the example of echo client server in the linux kernel.

            Hope it will help everyone who searched for it too.

            Source https://stackoverflow.com/questions/46300160

            QUESTION

            When using go http client Do method, can the httpResponse and the error be not nil at the same time?
            Asked 2017-Sep-26 at 14:26

            As visible in the official documentation as well as almost everywhere else online, the common pattern for handling http client errors is the following:

            ...

            ANSWER

            Answered 2017-Sep-26 at 14:26

            Yes, they can both be non-nil in one situation, apparently. From the source, we see:

            Source https://stackoverflow.com/questions/46423385

            QUESTION

            Goroutine in IO wait state for long time
            Asked 2017-Feb-15 at 14:37

            I have a heavy traffic server(more than 800K qps) with go1.7.

            From http://urltoserver:debugport/debug/pprof/goroutine?debug=2 I see 8K goroutines out of which almost 1800 are in IO wait for minutes. One of such goroutine stack is as below.

            ...

            ANSWER

            Answered 2017-Feb-15 at 14:37

            These could easily be clients the initiated a request but never completed it or slow clients etc.

            You should configure the Read/Write timeouts of your server (server.ReadTimeout and server.WriteTimeout respectively):

            Source https://stackoverflow.com/questions/42238695

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install netpoll

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cloudwego/netpoll.git

          • CLI

            gh repo clone cloudwego/netpoll

          • sshUrl

            git@github.com:cloudwego/netpoll.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Go Libraries

            go

            by golang

            kubernetes

            by kubernetes

            awesome-go

            by avelino

            moby

            by moby

            hugo

            by gohugoio

            Try Top Libraries by cloudwego

            kitex

            by cloudwegoGo

            hertz

            by cloudwegoGo

            volo

            by cloudwegoRust

            kitex-examples

            by cloudwegoGo

            shmipc-go

            by cloudwegoGo