Developing workerman-memcached, and the problems of multiworker and shared memory! #724
Replies: 10 comments 3 replies
-
Sorry, no plan. |
Beta Was this translation helpful? Give feedback.
-
Nvm, I'm almost done implementing it. Will upload on GitHub once complete and passes all test cases. Meanwhile, I'm stuck finding a way to communicate my storage (which is basically an array) and make it accessible across all workers. |
Beta Was this translation helpful? Give feedback.
-
I had implement a beanstalkd server via workerman, but it's not finish yet. |
Beta Was this translation helpful? Give feedback.
-
@xpader great to hear that. May be share your implementation repo when you have a chance. @walkor my
I'm done partially implementing the set/get parts of the memcache protocol, and since I have no way using multiple workerman workers, I am stuck with a single worker thread. Benchmarking both
I didn't add the benchmark with @walkor do you think there is a way/workaround to running more workers while accessing same memory? The problem is not reaching high benchmark rates, it related to being able to run another HTTP server that will be serving such data over my main application will definitely be hit if run using a single worker thread. |
Beta Was this translation helpful? Give feedback.
-
https://www.php.net/manual/zh/book.sem.php |
Beta Was this translation helpful? Give feedback.
-
Just done implementing shared memory using shmop which relies on shared memory segments as in here https://www.php.net/manual/en/ref.shmop.php, it worked fine, yet... performance was horrible, almost dropped down to 70 M/s which is around %30 of normal performance. Also tried apcu, it worked fine, yet, was around 95 M/s which is around %60 of normal performance. |
Beta Was this translation helpful? Give feedback.
-
Well, It appears I narrowed down the problem to the fact that the retrieval of data from the PHP array where I hold storage data is the main issue. I reached to this after many hours of testing and stripping the code over and over. I wanted to try Judy arrays but it seems it totally disappeared out of the PHP world and isn't supported anymore, so may be I'll write an extension for it. |
Beta Was this translation helpful? Give feedback.
-
@walkor any suggestions regarding a faster array-like data structure? 🤔 |
Beta Was this translation helpful? Give feedback.
-
I think the array is fast enough, it is not a bottleneck. There will be no obvious difference in optimizing it. |
Beta Was this translation helpful? Give feedback.
-
Hi @walkor
Do you have plans for creating a
workerman
based memcached server? or may be a Redis one.Beta Was this translation helpful? Give feedback.
All reactions