Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello world take so many memory #222

Closed
batobolg opened this issue Jul 13, 2016 · 2 comments
Closed

Hello world take so many memory #222

batobolg opened this issue Jul 13, 2016 · 2 comments
Labels

Comments

@batobolg
Copy link

  • Version:v4.4.7
  • Platform: Linux ainode06 3.10.0-327.10.1.el7.x86_64 Update README for help #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: CentOS 7

[bato@ainode06 nodejs]$ ./node-v4.4.7-linux-x64/bin/node -v
v4.4.7


my server.js is


[bato@ainode06 node-v4.4.7-linux-x64]$ cat server.js

const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

and after use ab command bench
the nodejs memory like this


[bato@ainode06 ~]$ ps u

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
bato      6150  0.0  0.0 151024  1780 pts/2    R+   15:06   0:00 ps u
bato     17496  0.0  0.0 115472  2248 pts/1    Ss   13:48   0:00 -bash
bato     19341 12.2  0.1 913832 60144 pts/1    Sl+  13:54   8:45 bin/node server.js

i don't know why node js take 60144kb memory just for hello world program. any information ?

@Knighton910
Copy link
Contributor

Knighton910 commented Jul 13, 2016

Here's what I'm getting from the same code, but diff system:

screen shot 2016-07-13 at 1 42 47 pm


But Let me check, if i can help you with yours

@Knighton910
Copy link
Contributor

click me 🔗

this article is touches on some problems with cent os & nodejs in development mode, but really is going in detail about the two in hosting & deploying -- specifically --

""" Just like on your development machine you can run node app.js on your server and your code will be executed perfectly.

However, this is far from ideal and there are many problems with it. Let’s look at just a few of them.

Serving static files, like JavaScript, images & CSS, can be done with node but it is not very efficient. It will use too much memory and it might not cache frequently accessed files, which in result can make your Node app slow or even crash it. """


click me 🔗

The Installing Node.js via package manager page has a nice page with specific sections about
CENT OS


[personal opinion]

I think from what i searched is, there isn't a plethora amount of nodejs & cent os experience going on
but i'm sure you will find enough to get by to fix your problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants