You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Ants with fasthttp. Is it possible that this both packages are not compatible?
My Program fetchs 15000 rows from a MysqlDB and request the HTML code for parse 2 strings out of it.
My memory usage is crazy 1,9g with only 434 open socket files = 434 connections (maximum was around 2800): 15921 jonny 20 0 3093,3m 1,9g 6,9m S 7,3 25,1 11:59.63 goCheckResults
It is crazy how much memory usage this small program has.
I asked the question to the Ants developer @panjf2000 and he told me:
It's unnecessary to use ants in fasthttp because there is already a goroutine pool in fasthttp which is also the prototype of ants, so using ants with fasthttp makes no improvement but performance loss.
I checked the godoc of fasthttp and found:
workerPool serves incoming connections via a pool of workers
in FILO order, i.e. the most recently stopped worker will serve the next
incoming connection.
Unfortunately this answer of the Ants Developer does not help me, but since he is the Ants developer he is for sure right regarding using Ants with Fasthttp.
So my question is, why is the Memory Consumption so huge and should i remove Ants and just execute go processRow() ?
The fasthttp Project seems to be a very great project, unfortunately there are very less examples regarding fasthttp Client Requests - most of the examples and also most of the Google Results are about running Webservers with fasthttp.
I appreciate someone help me regarding my problem. Thank you very much!
The text was updated successfully, but these errors were encountered:
Hello,
I am using Ants with fasthttp. Is it possible that this both packages are not compatible?
My Program fetchs 15000 rows from a MysqlDB and request the HTML code for parse 2 strings out of it.
My memory usage is crazy 1,9g with only 434 open socket files = 434 connections (maximum was around 2800):
15921 jonny 20 0 3093,3m 1,9g 6,9m S 7,3 25,1 11:59.63 goCheckResults
root@jdebian:~$ ls -l /proc/15921/fd | wc -l
434
in main():
The function processRow calls
It is crazy how much memory usage this small program has.
I checked the godoc of fasthttp and found:
Unfortunately this answer of the Ants Developer does not help me, but since he is the Ants developer he is for sure right regarding using Ants with Fasthttp.
So my question is, why is the Memory Consumption so huge and should i remove Ants and just execute
go processRow()
?The fasthttp Project seems to be a very great project, unfortunately there are very less examples regarding fasthttp Client Requests - most of the examples and also most of the Google Results are about running Webservers with fasthttp.
I appreciate someone help me regarding my problem. Thank you very much!
The text was updated successfully, but these errors were encountered: