rabbtimq非持久化测试
send端代码
import pika,time,threading
class send():
def __init__(self,que_nam='hello'):
self.credentials = pika.PlainCredentials('mytest', 'mytest')
self.connection = pika.BlockingConnection(pika.ConnectionParameters(host='192.168.157.132',credentials=self.credentials))
self.channel = self.connection.channel()
self.channel.queue_declare(queue=que_nam)
def action(self,msgj='ndyd 996'):
while True:
self.channel.basic_publish(exchange='',
routing_key='hello',
body=msgj)
print(" [x] Sent %s" %msgj)
time.sleep(0.5)
def lll(self):
li=[]
for i in range(,):
th=threading.Thread(target=self.action())
th.start()
li.append(th)
for i in li:
i.join()
# connection.close()
song=send()
song.lll()
消费端代码
import pika class send():
def __init__(self,msg='ndyd 996',que_nam='hello'):
self.credentials = pika.PlainCredentials('mytest', 'mytest')
self.connection = pika.BlockingConnection(pika.ConnectionParameters(host='192.168.157.132',credentials=self.credentials))
self.channel = self.connection.channel()
self.channel.queue_declare(queue=que_nam) def callback(self,ch, method, properties, body):
print(" [x] Received %r" % body) def start(self):
self.channel.basic_consume(self.callback,
queue='hello',
no_ack=True) print(' [*] Waiting for messages. To exit press CTRL+C')
self.channel.start_consuming()
song=send()
song.start()
rabbitmq配置
[root@localhost ~]# free -h
total used free shared buff/cache available
Mem: 472M 107M 296M 1.5M 67M 326M
Swap: .0G 88M .9G
[root@localhost ~]# lscpu
Architecture: x86_64
CPU op-mode(s): -bit, -bit
Byte Order: Little Endian
CPU(s):
On-line CPU(s) list:
Thread(s) per core:
Core(s) per socket:
Socket(s):
NUMA node(s):
Vendor ID: GenuineIntel
CPU family:
Model:
Model name: Intel(R) Core(TM) i5-6300HQ CPU @ .30GHz
Stepping:
CPU MHz: 2303.139
BogoMIPS: 4608.00
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 6144K
NUMA node0 CPU(s):
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec arat
稳定发送速率

停止接收端 rabbitmq 瞬间崩溃

rabbtimq非持久化测试的更多相关文章
- redisd的非持久化配置
如何关闭redis持久化?我的需求是只把redis当作缓存来用,所以持久化到硬盘对我的需求来说没有意义. 修改redis配置文件,redis.conf 第115行左右. 1.注释掉原来的持久化规则 # ...
- JMS开发步骤和持久化/非持久化Topic消息
------------------------------------------------ 开发一个JMS的基本步骤如下: 1.创建一个JMS connection factory 2.通过co ...
- JMS学习(五)--ActiveMQ中的消息的持久化和非持久化 以及 持久订阅者 和 非持久订阅者之间的区别与联系
一,消息的持久化和非持久化 ①DeliveryMode 这是传输模式.ActiveMQ支持两种传输模式:持久传输和非持久传输(persistent and non-persistent deliver ...
- RabbitMQ学习笔记(6)----RabbitMQ 持久化和非持久化
持久化:将交换机或队列数据保存到磁盘,服务器宕机或重启之后依然存在. 非持久化:将交换机或队列的数据保存到内存中,服务器宕机或重启之后数据将不存在. 在RabbitMQ中也提供了持久化和非持久化方式. ...
- RabbitMQ持久化和非持久化
但是,非持久化要比持久化速度更快. 队列是否需要持久化:看需求
- maven dubbo zookeeper 项目搭建(有效)jar包非war测试
zookeeper安装以及dubbo-admin.war(管理端)配置启动,本章省略,参考其他内容 这里主要说服务提供者和消费者 项目结构: 1)服务端 DemoServer.java package ...
- PostgreSQL 非持久化设置(Non-Durable Settings)
Durability is a database feature that guarantees the recording of committed transactions even if the ...
- ActiveMQ broker 非持久化queue消息的入队、出队和应答
消息入队:Queue.doMessageSend 消息分发:Queue.doActualDispatch 消息发送:TransportConnection.dispatch broker收到consu ...
- 单核CPU并发与非并发测试
多线程运行程序的目的一般是提高程序运行效率并且能够提高硬件的利用率比如多核CPU,但是如果我们只有单核CPU并发运行程序会怎样呢? 我以两个环境作为对比: 环境A(我本机8c) 环境B(我的云服务器1 ...
随机推荐
- SQL优化 MySQL版 - 避免索引失效原则(一)
避免索引失效原则(一) 精力有限,剩余的失效原则将会在 <避免索引失效原则(二)>中连载出来,请谅解 作者 : Stanley 罗昊 [转载请注明出处和署名,谢谢!] 避免索引失效的一些原 ...
- async/Await使用和原理
await/async是.NetFramework4.5出现的,是语法糖,由编译器提供的功能! await/async 是C#保留关键字,通常是成对出现,一般的建议是:要么不用,要么用到底 async ...
- VsCode+Node的前端环境搭建及其理解并创建一个前端目录
既然选择了远方,便只顾风雨兼程 __ HANS许 系列:零基础搭建前后端分离项目 系列:零基础搭建前后端分离项目 VsCode VsCode的安装 VSCode中文设置 VsCode 扩展 VsCod ...
- centos7 ipaddr 无法查看虚拟机IP解决办法
原因是: CentOS 7 默认是不启动网卡的 解决办法:https://blog.csdn.net/wxx729418277/article/details/79130649
- Web前端2019面试总结
基础知识点 1.水平垂直居中 子绝父相,子盒子设置绝对定位,设置top:50%;left:50%,margin-top:-50%;margin-left:-50%; 子绝父相,子盒子设置绝对定位, ...
- iOS----------use_frameworks!
1.https://segmentfault.com/a/1190000007076865 2.https://www.jianshu.com/p/8269e4cac48f 3.https://www ...
- 人脸检测识别,人脸检测,人脸识别,离线检测,C#源码
百度网盘地址 微云地址 使用虹软人工智能开放平台技术开发完成
- 30号快手笔试(三道ac两道半)————-历史上最大的网络失误orz
case 50 ,20,100 做题以来第一次重大失误:最后两分钟发现手机关机了,然后充电开机orz 页面是js代码, 钟表是一直会走的, 手机没电了, 电脑连接的手机的热点: 只顾在调试,先过了第 ...
- (办公)springboot配置表单验证@Valid
项目用到了springboot,本来很高兴,但是项目里什么东西都没有,验证,全局异常这些都需要自己区配置.最近springboot用的还是蛮多的,我还是做事情,把经验发表一下. SpringBoot提 ...
- 啰嗦的 java,简洁的 lombok —— lombok 的使用及简单实现单例模式注解
lombok 是什么? lombok 是一个非常神奇的 java 类库,会利用注解自动生成 java Bean 中烦人的 Getter.Setting,还能自动生成 logger.ToString.H ...