SMPP短信接收速度
我们开发了 SMPP 应用程序。它的短信接收速度仅为每秒16条短信。 我怎样才能提高这个速度?
We have developed SMPP application. It's SMS receiving speed is mere 16 SMS per second.
How can i increase this speed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先也是最重要的,我建议让 JRat 来分析应用程序。在优化之前你需要知道哪里需要优化。
话虽这么说,我也经历过这个。我遇到的最大瓶颈是 ServerPDUEventListener 实现 - 在我的第一个版本中,我正在处理该类中的所有传入 PDU - 序列化对它们的访问 - 有些正在执行数据库访问!我解决这个问题的方法是为我实际上想要以更详细的方式处理的 PDU 生成线程 - 在我的例子中,这是
DELIVER_SM
PDU 和SUBMIT_SM_RESP
PDU但这取决于您正在开发的实际应用程序。在单独的线程中处理它们意味着我的主 ServerPDUEventListener 可以自由地继续处理下一个 PDU。瓶颈类似于实现服务器套接字 - 每当您接受
客户端套接字时,您都希望返回侦听其他传入连接并在单独的线程中处理通信。First and foremost, I recommend getting JRat to profile the application. You need to know where to optimize before optimizing.
That being said, I went through this as well. The biggest bottleneck I encountered was the
ServerPDUEventListener
implementation - in my first version, I was treating all incoming PDUs in that class - which serialized access to them - and some were doing database access! The way I solved this is by spawning threads for the PDUs which I actually wanted to process in a more detailed manner - in my case this was theDELIVER_SM
PDUs and theSUBMIT_SM_RESP
PDUs but that depends on the actual application you are developing. Handling them in separate threads meant my mainServerPDUEventListener
was free to keep processing the next PDUs. The bottleneck is similar to implementing a server socket - whenever youaccept
a client socket, you want to return to listening for other incoming connections and handle the communication in a separate thread.它是什么样的应用程序,用 Java 编写的?
有几件事
1. 查看处理过程中哪些地方花费了最多时间。这将导致一个解决方案
2. 可以优化处理流程以对消息进行排队和处理。
还涉及其他因素,如硬件配置等,但普通硬件可以提供不错的性能。
What kindof application it is, written in Java?
Couple of things
1. See where it is taking most of the time in processing. This would lead to a solution
2. Can optimize the processing flow to queue and process the messages
There are other factor involved as well, like hardware configuration etc, but normal hardware gives a decent performance.
首先以异步模式处理所有传入和传出的短信。例如,在 jsmpp 库中,您可以以异步和同步模式处理所有流量。第一种模式速度更快。
如果可能的话,在单独的线程中处理所有繁重的业务逻辑,如果可能的话,例如在企业 java beans 中。如果您的流量很大并且业务逻辑太重,那么在 smpp 和企业 java beans 中使用异步模式来处理业务逻辑可以极大地改善您的应用程序架构。
First of all process all incoming and outgoing sms in the asynchronous mode. For example in the jsmpp lib you can process all traffic in the asynchronous and synchronous mode. The first mode is mach faster.
If possible process all your heavy business logic in the separate threads and if possible for example in the enterprise java beans. If your traffic is very big and business logic too heavy then using asynchronous mode in the smpp and enterprise java beans for business logic can very improve your application architecture.