Set higher priority for Meteor process (Mac)

Hi everybody,

I was looking for a way to give a higher priority to Meteor process on my computer (macOS), it takes maybe ~40-50 seconds for the server to reload (due to the current project I am working on).

I found this topic on StackOverflow :

Now if I take a look to my active processes :
a

Would it be enough if I use the nice command (as I see on StackOverflow) in my npm script ? Or do I have to target all the processes (node / mongod) ?

nice -n 20 meteor --settings <settings_path>

Have you ever had to do this ? Some advices / warning maybe ?

Thank you.

Your system does not appear to be very busy. Raising the priority isn’t going to make a difference.

It would be every process, but as I say, it won’t make any significant difference.

You are right, my laptop is not very busy. But I was hoping, maybe, to improve server reload/etc.

By any chance, do you know any way to do this ? Instead of just getting a new recent computer.

Before you can improve performance, you need to know where your bottlenecks are. For meteor development it’s usually disk.

I don’t use OSX, but in linux you can run sar to get performance metrics - although the granularity may be too coarse. Alternatively, try top which samples more frequently. You may find this helpful:

However, at the end of the day, most issues tend to boil down to the hardware. You may be able to make a small incremental improvement by installing an SSD, but find your bottlenecks first!

I already installed a SSD and upgraded my RAM to 8 Go.
I will take a look to your link, I appreciate @robfallows thanks.

You could also do a quick audit of your file structure - check for files which are in the wrong place. One symptom of that is editing a client file which causes the server to reload (or vice versa).

Have you run meteor with profiling? For example:

METEOR_PROFILE=1000 meteor --settings xxx

will log steps taking longer than 1000ms (1s) to complete (you can adjust the value to suit). I’ve seen cases where a large js file has been accidentally included in the build and that command has highlighted it.

However, your project may just be very complex (lots of local packages, npm modules and build files). In which case, new hardware may be the only way to go.

1 Like

The thing is (and I think it is one of the main reason) my current project use (unfortunately) Meteor 1.1.0.2, with almost 1500 files (for example a SCSS file with ~9000 lines… :cry: ). It is planned to improve all of this (structure and Meteor version), but that’s not the priority for some person here)

I will try what you say.

OK, but changing an scss file should not cause a server reload.

Concerning this SCSS file, for example, when it is changed only the client is refreshed (logged in the Terminal).
But the delay for detecting a change in this file, or any another “client file” take something like 30 seconds.

When a server file is modified, the change is detected more quickly, something like ~2 seconds. And I currently use this “trick” for whatever change I make in a file.

But then, the server has to reload too…

@robfallows, I tried starting my project using METEOR_PROFILE=1000.
Here is the output : https://pastebin.com/cJ292Kw9

I am quite not sure what to do with this. Okay I see some high numbers but I have to admit I do not know which points should I take a deeper look.