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非持久化测试的更多相关文章

  1. redisd的非持久化配置

    如何关闭redis持久化?我的需求是只把redis当作缓存来用,所以持久化到硬盘对我的需求来说没有意义. 修改redis配置文件,redis.conf 第115行左右. 1.注释掉原来的持久化规则 # ...

  2. JMS开发步骤和持久化/非持久化Topic消息

    ------------------------------------------------ 开发一个JMS的基本步骤如下: 1.创建一个JMS connection factory 2.通过co ...

  3. JMS学习(五)--ActiveMQ中的消息的持久化和非持久化 以及 持久订阅者 和 非持久订阅者之间的区别与联系

    一,消息的持久化和非持久化 ①DeliveryMode 这是传输模式.ActiveMQ支持两种传输模式:持久传输和非持久传输(persistent and non-persistent deliver ...

  4. RabbitMQ学习笔记(6)----RabbitMQ 持久化和非持久化

    持久化:将交换机或队列数据保存到磁盘,服务器宕机或重启之后依然存在. 非持久化:将交换机或队列的数据保存到内存中,服务器宕机或重启之后数据将不存在. 在RabbitMQ中也提供了持久化和非持久化方式. ...

  5. RabbitMQ持久化和非持久化

    但是,非持久化要比持久化速度更快. 队列是否需要持久化:看需求

  6. maven dubbo zookeeper 项目搭建(有效)jar包非war测试

    zookeeper安装以及dubbo-admin.war(管理端)配置启动,本章省略,参考其他内容 这里主要说服务提供者和消费者 项目结构: 1)服务端 DemoServer.java package ...

  7. PostgreSQL 非持久化设置(Non-Durable Settings)

    Durability is a database feature that guarantees the recording of committed transactions even if the ...

  8. ActiveMQ broker 非持久化queue消息的入队、出队和应答

    消息入队:Queue.doMessageSend 消息分发:Queue.doActualDispatch 消息发送:TransportConnection.dispatch broker收到consu ...

  9. 单核CPU并发与非并发测试

    多线程运行程序的目的一般是提高程序运行效率并且能够提高硬件的利用率比如多核CPU,但是如果我们只有单核CPU并发运行程序会怎样呢? 我以两个环境作为对比: 环境A(我本机8c) 环境B(我的云服务器1 ...

随机推荐

  1. 105 - kube-scheduler源码分析 - predicate算法注册

    一.predicate注册过程 今天我们来聊聊predicate函数是怎么被注册进去的,也就是要执行的一堆predicate是怎么成为“选中的孩子”.  代码位置:pkg/scheduler/fact ...

  2. SmartSql 常见问题

    常见问题 为什么不支持 Linq? SmartSql 希望 开发人员更多的接触 Sql ,获得绝对的控制权与安全感.所以目前没有计划支持 Code First 编程模式. 我想好了Sql怎么写,然后再 ...

  3. RDIFramework.NET代码生成器全新V3.5版本发布-重大升级

    发布说明 RDIFramework.NET代码生成器V3.5版本全新震撼推出,相比上次版本,本次发布新增与修改的内容如下: 1.全新增加了WinForm界面代码的生成,可直接生成常用的主界面(集新增. ...

  4. Data Lake Analytics + OSS数据文件格式处理大全

    0. 前言 Data Lake Analytics是Serverless化的云上交互式查询分析服务.用户可以使用标准的SQL语句,对存储在OSS.TableStore上的数据无需移动,直接进行查询分析 ...

  5. SpringBoot基础系列-SpringCache使用

    原创文章,转载请标注出处:<SpringBoot基础系列-SpringCache使用> 一.概述 SpringCache本身是一个缓存体系的抽象实现,并没有具体的缓存能力,要使用Sprin ...

  6. 原生js轮盘抽奖实例分析(幸运大转盘抽奖)

    效果图: 所需图片素材: 这张图是pointer.png的位置的. turntable-bg.jpg这张是转盘背景图,在背景位置. 这张是turntable.png位置的. 需要这三张图片,如果要实现 ...

  7. 数据结构——Java实现链栈

    一.分析 栈是限定仅在表的一端进行插入或删除操作的线性表,对于栈来说,操作端称为栈顶,另一端则称为栈底,栈的修改是按照后进先出的原则进行的,因此又称为后进先出的线性表. 链栈是指采用链式存储结构实现的 ...

  8. css文字超出一行用点表示

    1,css超出一行用点表示 white-space:nowrap; overflow:hidden; text-overflow:ellipsis; 2,css超出二行用点表示 overflow:hi ...

  9. C# 文件绝对路径与相对路径的转换

    class Program { const string CONFIG_PATH = @"C:\SoftWare\Config.xml"; const string IMAGE_P ...

  10. Glide的 java.lang.RuntimeException: Expected instanceof GlideModule, but found:X.GlideModule@2e4554f

    问题一 在添加过混淆规则后,App打包的时候,发现报错了 java.lang.RuntimeException: Expected instanceof GlideModule, but found: ...