last day (26 days later) » 

12:45 PM
2
Q: why node js is slower than chrome?

hamidI am creating a website using nodejs. In a page of my website, i request to google then parse its results and send them to the user. I use request module of npm to request to google. request module has a flag called time that if i set it to true then request gives me details of timing of the requ...

 
Could be kind of a "cahed" ip from chrome???
 
@AlejandroTeixeiraMuñoz Thanks for fast reply. I am using ip address of google so it can not be.
 
I would create an automatic "ready to search" ip connection under my own browser if I were google. Don't you?? Did you compared the results to another browser different than google's chrome?
I mean, maybe google gives quicker respones because of it's chrome, or chrome has an internal google's functionality that allows to connect faster..
 
@AlejandroTeixeiraMuñoz I have tested google in firefox and i got the same results. I mean google is so faster than my nodejs server.
 
which dns servers are u using with your node.js servers? are the same as your OS's ones?
 
12:45 PM
my device and the nodejs server are in a same city so i think both of them uses same dns server. I have tested this in localhost and got the same result. I mean i do not think main reason is dns.
 
The DNS is something configured in your local system, and it can change.lt's not related to your geographical position. Please, check this answer and configure the 8.8.8.8 DNS that appears there stackoverflow.com/a/45453257/3617531
Check also this one @hamid -> nodejs.org/api/dns.html#dns_dns here appears how to get the ip, and then call it
 
@AlejandroTeixeiraMuñoz If i use ping command to find the ip address does it give right ip address?
 
Hamid??
u therre??
 
hi
 
hi!!
nice to help you!!
what i was trying to explain
 
12:46 PM
thanks
 
is that
when you look for a name on internet
you need to call a DNS server
Domain Name Servers are the ones that store
all domain names
and derive you to the IP of that name
if you need to call a known IP, just dont use the name and call the IP
if you need to call domain names
you should try to perform then as they explain in stackoverflow.com/questions/40985367/…
 
can i use ping command to find ip?
is it right?
 
really you should not
because ping is doing a different thing
you sould call a DNS lookup
because ping will do the same
but if you just need to call one place
one time
you can check the ip with ping (if the remote admin didn't turn off ping services as usual)
and then set the ip as servername
if you call the ip
you should not feel the difference between chrome and nodejs appart from little points, as in download section timings
Regarding to using just the IP, i remember you that big service providers change ips around time, and that's because dns (nameservers) are there -> lifewire.com/what-is-the-ip-address-of-google-818153
check this link
there are plenty of them and is possible that the servers will give you the better one for you geographical position.
so you should use dns resolution from node, but in a proper way I think
 
i did as you say
i got the google ip by ping command
and this difference is for using the ping ip address
 
is going faster?
 
12:56 PM
i have did this before asking question
i mean this difference is for the time that i use ip of ping
 
but you wrote "Google.com" not the IP
headers: {
'host': 'www.google.com'
},
 
i use this url
'https://<google-ip>/search?q=' + req.query.query + '&num=30&start=0'
 
and where is "<google-ip>"? I don't see any IP
 
and in <google-ip> i use 172.217.16.164
 
And is it the same you are calling from the DNS?
 
12:59 PM
i did not put ip in this question but in practice i used
@AlejandroTeixeiraMuñoz i find this ip from ping
 
Yeah, that's because I ask you. Because I don't really know how "Ping" finds the ip, i suppose that the same way as your SO
which SO do you have?
OS
sorry
 
windows
but in the server i use ubuntu
and i find this ip from ubuntu
 
hummm
1
Q: Node.js http requests much slower than browser or .NET

zewrI'm using the latest Node.js v8.9.3 to make requests to a RESTful API and I'm getting very disappointing results in terms of performance. The best results I get are ~800ms using node, while it takes around ~300ms for the same request to complete from the browser, using curl or a simple two lines...

similar here
Ummm I think I have it
5
A: Delays in HTTP requests via Node.js compared to browser

Rob RaischThere are several potential issues you'll need to address given what I understand from your architecture. In no particular order they are: Using request will always be slower than using http directly since as the wise man once said: "abstraction costs". ;) In fact, to squeeze out every possible...

;)
I think your question can be marked as duplicated as this one is more detailed now, and in StackOverflow usually we try to remove duplicates
but I think we have the solution also
3
A: Delays in HTTP requests via Node.js compared to browser

Tristan FoureurActually, I have some new elements good enough to open a real answer. Having a look at the way request uses the HTTP agent can you please try the following : var baseRequest = request.defaults({ pool: false, agent: false, jar: true, json: true, timeout: 5000, gzip: true, ...

chech this late answer too
 
thanks a lot. i think these references are good
 
yeah it seems :) It was a mix of our initial ideas. but as you see, is a question of how the language handles those functions
I hope this helped !!
please, remember to upvote the question and answers that are helping you!!!
 
1:09 PM
sure
 
1:28 PM
See you @hamid !! If you need anything more just tell me !! I'll close the chat!! nice to meet you!! bye!!
 
thanks a lot again.
bye
 

last day (26 days later) »