Coder Social home page Coder Social logo

High server CPU usage about crater HOT 10 OPEN

jcoreio avatar jcoreio commented on June 20, 2024
High server CPU usage

from crater.

Comments (10)

jedwards1211 avatar jedwards1211 commented on June 20, 2024

Huh, okay, can you export the profiling results and email them to me?

from crater.

jedwards1211 avatar jedwards1211 commented on June 20, 2024

I've seen some background node processes get stuck at 100% cpu on my comp but I haven't figured out why, or if it's related.

from crater.

darkadept avatar darkadept commented on June 20, 2024

Ok. I can finally reproduce it! It's definitely something with the Meteor login code. I'll try to outline the steps to reproduce it again:

  1. git clone a fresh crater
  2. add accounts-base to meteor packages
  3. run crater server
  4. access crater from browser (leave tab open), observe normal server cpu usage
  5. stop crater server
  6. In browser's tab add the following to local storage:
Meteor.userId                      <some random id>
Meteor.loginToken               <some random code>
Meteor.loginTokenExpires     <some date>
  1. close tab
  2. start crater server again
  3. access crater from browser, observe high server cpu usage

There is another way to trigger the problem:

  1. git clone a fresh crater
  2. add accounts-base to meteor packages (I think you also need accounts-password for this too)
  3. add a link on one of the pages to run Meteor.loginWithPassword('random user', 'random password')
  4. run crater server
  5. access crater from browser (local storage should be blank), observe normal server cpu usage
  6. click on link that runs Meteor.loginWithPassword(), observe high server cpu usage
  7. note that local storage is still blank because of non existent random user in login call

I have two profiles recorded, on that is good (with normal cpu usage) and one that is bad (with high cpu usage). I'll email them over to you.

from crater.

darkadept avatar darkadept commented on June 20, 2024

Oh, I'll just upload the profiles here.

Crater #106 Profiles.zip

from crater.

jedwards1211 avatar jedwards1211 commented on June 20, 2024

Hmmm, I wonder if I'm doing something dumb in the way I sync mongo data into redux that's churning unnecessarily. Expanding the worst offenders doesn't yield much specific information...here's what I see. Did you see high CPU usage from the browser too?

image

from crater.

darkadept avatar darkadept commented on June 20, 2024

No. My if I profile my browser it seems fine. Mostly (idle). In fact, if I close my browser the cpu on the server stays pinned.

from crater.

jedwards1211 avatar jedwards1211 commented on June 20, 2024

Weird. Any idea if you see the same thing with an equivalent pure-meteor app?

from crater.

darkadept avatar darkadept commented on June 20, 2024

I'll check it out and report back.

from crater.

darkadept avatar darkadept commented on June 20, 2024

Ok. I thought I had tried this already but I obviously didn't. I tried using Node 4 instead of 6. And it's fine now.

Node: v4.7.3
Npm: v2.15.11

This is working fine. I guess Meteor is still on node v4 so there is no real way to test a plain Meteor app with node v6. I'm guessing that if I could it would cause the same problem. Maybe, anyways.

You may want to change the line in the README that says tested on Node 6.

from crater.

jedwards1211 avatar jedwards1211 commented on June 20, 2024

Hmm. Well the CI setup does perform integration tests on Node 6, not that they would catch an issue like this. When I find time I'll try to figure out exactly what's going on

from crater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.