search

Home  >  Q&A  >  body text

node.js - In node, an encryption operation takes 69ms, is it acceptable?

An operation of encrypting user passwords is synchronous and takes 69ms. Is it acceptable?

If there are a large number of users and multiple people register at the same time, will it cause the node process to crash

Please ask God for answers. .

PHP中文网PHP中文网2759 days ago686

reply all(5)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 13:33:05

    Multiple people register at the same time...

    How much more can it reach 10k? Moreover, it is all blocked and encrypted synchronously. It will not crash, it will just be slower.

    If you are worried, just take a test and you will know.

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 13:33:05

    It will not crash. CPU operations cannot be asynchronous. All asynchronous operations are IO operations

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:33:05

    I want to know what kind of complex encryption is it that takes so long? I found that multiple new Date() also have time differences

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:33:05

    Use ab to stress test the interface, and you will know whether it will crash and whether the speed is acceptable.

    In case of crash, use PM2 to start the service. PM2 can automatically wake it up for you.

    PS: Your encryption operation here takes 69ms, but finish takes 600ms. If this finish refers to http finish, the biggest performance bottleneck is your framework

    reply
    0
  • 黄舟

    黄舟2017-05-16 13:33:05

    Since you can’t accept it, change the encryption process to asynchronous one

    reply
    0
  • Cancelreply