goofansu
goofansu

Reputation: 2277

Erlang node suffers high cpu

I use perf to detect the node's process

Perf command: perf record -g -p 13586 sleep 10

Result:

# Events: 7K cpu-clock
#
# Overhead  Command       Shared Object                                Symbol
# ........  .......  ..................  ....................................
#
    17.02%     beam  beam                [.] copy_struct
               |
               --- copy_struct

    12.38%     beam  beam                [.] size_object
               |
               --- size_object

    11.85%     beam  beam                [.] db_prog_match
               |
               --- db_prog_match

     7.78%     beam  beam                [.] db_select_hash
               |
               --- db_select_hash

     6.90%     beam  beam                [.] process_main
               |
               --- process_main

     4.70%     beam  beam                [.] do_minor
               |
               --- do_minor

     4.23%     beam  beam                [.] element_2
               |
               --- element_2

     3.30%     beam  beam                [.] sweep_one_area
               |
               --- sweep_one_area

     1.53%     beam  beam                [.] cmp
               |
               --- cmp

     1.39%     beam  beam                [.] copy_shallow
               |
               --- copy_shallow

As you can see, the copy_struct and size_object cost much.

Are the schedulers are busy in copying messages?

FYI, I sorted reductions desc and fetched top 10 processes on the node, it seems normal.

As we have about 6 nodes on one system, so smp is disabled. Shall we open it on?

Upvotes: 1

Views: 257

Answers (1)

Lukas
Lukas

Reputation: 5327

copy struct is used whenever a term in general has to be copies, not only for messages.

Since db_* also are quite high I would imagine that the copy structs come from copying data to and from ets tables.

regarding if you should use smp or not, it might make the system perform better, but you really should try it and measure the results for your system as it will vary depending on what your system does.

Upvotes: 2

Related Questions