node.js - In node, an encryption operation takes 69ms, is it acceptable?
PHP中文网
PHP中文网 2017-05-16 13:31:05
0
5
716

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中文网

认证0级讲师

reply all(5)
仅有的幸福

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.

小葫芦

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

Peter_Zhu

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

phpcn_u1582

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

黄舟

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template