当前位置: 首页 > news >正文

wordpress多站点换域名希爱力双效片副作用

wordpress多站点换域名,希爱力双效片副作用,动态网站设计,24小时在线地址失效域名准备工作 下载windows版的Redis(自行查找网络资源) 解压到指定文件夹 如图所示:Redis的目录结构 redis本质上也是一个数据库,只不过经常被用作缓存 。redis分为服务端和客户端,先启动服务器redis-server,在…

准备工作

下载windows版的Redis(自行查找网络资源)

解压到指定文件夹

 如图所示:Redis的目录结构

  • redis本质上也是一个数据库,只不过经常被用作缓存 。
  • redis分为服务端和客户端,先启动服务器redis-server,在使用redis-cli命令行连接服务器。

 基于配置文件启动redis服务器

如果我们自定义了redis服务器的相关配置,例如最大连接数,数据库总数等,需要以指定配置文件的方式启动redis服务器,可以进行以下配置。

在redis的目录中新建一个文件startup.cmd,用记事本或其他文本编辑工具打开,然后写入以下内容:

redis-servle redis.windows.conf

双击这个cmd文件,启动redis服务器

显示redis服务器的基本信息,如端口(port:6379)等。

 在Java程序中使用Redis

在Java中使用redis工具,要先下载jedis.jar包,把它加载到工厂的路径中,如果使用的maven项目,直接添加对应的依赖坐标即可。

 pom.xml

    <dependency><groupId>redis.clients</groupId><artifactId>jedis</artifactId><version>2.9.0</version></dependency>

在测试类中连接redis测试


/*** Unit test for simple App.*/
public class AppTest{@Testpublic void jedisTest(){Jedis jedis=new Jedis("localhost",6379);int i=0;//记录次数try{long start = System.currentTimeMillis();while (true){long end = System.currentTimeMillis();if (end-start>=1000){break;}i++;jedis.set("test"+i,i+"Jedis");}}finally {jedis.close();}System.out.println("redis每秒操作:"+i+"次");}}

以上代码的含义:

  1. 获取连接redis服务器的Jedis对象
  2. 先获取当前时间的毫秒值
  3. 进行死循环,当时间过去1秒时,停止循环
  4. 在这1秒内向redis服务器中存入数据
  5. 输出redis存入了多少条数据

 运行结果:

每个人的电脑的执行次数都是不同的,我这里显示的是我执行效果最好的一次,通常我的只有3万5千次。其实redis的速度不仅仅如此,比这快的多,这里较慢的原因是我们只是一条条地将命令发送给redis去执行。如果使用流水线技术它的速度回快得多,将可以达到10万次每秒的操作,十分有利于系统性能的提高。

可以看出redis的写数据的速度是非常快的:

本质原因有三点:

  • 它是基于ANSI C语言编写的,接近于汇编语言的机器语言,运行十分快速
  • 它是基于内存读/写,速度比数据库的磁盘读/写要快的多
  • 它的数据库结构只有6种数据类型,数据结构简单,因此规则较少,而数据库则是范式,完整性、规范性需要考虑的规则比较多,处理业务会比较复杂

扩展

向MySQL数据库写数据

 我利用mybatis想mysql数据库插入新的数据,具体代码不给出,主要观察执行效果以及和redis的对比

 测试类

package com.csx;import com.csx.dao.UserDao;
import com.csx.entity.User;
import com.csx.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;
import redis.clients.jedis.Jedis;/*** Unit test for simple App.*/
public class AppTest{private SqlSession sqlSession= SqlSessionFactoryUtil.getSessionSql();@Testpublic void testMybatis(){UserDao userDao = sqlSession.getMapper(UserDao.class);int i=0;//记录次数long start = System.currentTimeMillis();while (true){long end = System.currentTimeMillis();if (end-start>=1000){break;}i++;User user =new User();user.setName("User"+i+"-vip");user.setAge(i);userDao.insertUser(user);}System.out.println("Mysql每秒操作:"+i+"次");}}

代码逻辑和redis进行的操作一样,这里是向mysql数据库在1秒内插入的数据数量

 执行效果

可以看的出来mysql相比于redis,写入数据的效率低太多。因此mysql适合持久化数据,而redis通常用来作为缓存使用 


文章转载自:
http://wanjiaputrefactive.stph.cn
http://wanjiacompressional.stph.cn
http://wanjiaepochmaking.stph.cn
http://wanjiahyposcope.stph.cn
http://wanjiaillite.stph.cn
http://wanjiacast.stph.cn
http://wanjiaheadend.stph.cn
http://wanjiaintercom.stph.cn
http://wanjiamurkily.stph.cn
http://wanjiaeluviate.stph.cn
http://wanjialegendarily.stph.cn
http://wanjiafreshness.stph.cn
http://wanjiacellulitis.stph.cn
http://wanjiarealtor.stph.cn
http://wanjiagrammaticalize.stph.cn
http://wanjiasouslik.stph.cn
http://wanjiaguerilla.stph.cn
http://wanjiaflorida.stph.cn
http://wanjiatore.stph.cn
http://wanjiadrown.stph.cn
http://wanjiavesuvian.stph.cn
http://wanjiaoyes.stph.cn
http://wanjiaexploitative.stph.cn
http://wanjiaacritical.stph.cn
http://wanjiaerotogenic.stph.cn
http://wanjiaglimmer.stph.cn
http://wanjiagermander.stph.cn
http://wanjiaanear.stph.cn
http://wanjiaoxhide.stph.cn
http://wanjiadiazine.stph.cn
http://wanjiagael.stph.cn
http://wanjiazooful.stph.cn
http://wanjiainkpot.stph.cn
http://wanjiamultidisciplinary.stph.cn
http://wanjiasapphism.stph.cn
http://wanjiaprotostellar.stph.cn
http://wanjiaatlantean.stph.cn
http://wanjiacheckerbloom.stph.cn
http://wanjiaultramafic.stph.cn
http://wanjiaunderdeveloped.stph.cn
http://wanjiaregard.stph.cn
http://wanjiaunafraid.stph.cn
http://wanjiacrum.stph.cn
http://wanjiaapprehensive.stph.cn
http://wanjiacantala.stph.cn
http://wanjianachtlokal.stph.cn
http://wanjianicaea.stph.cn
http://wanjiasubmersed.stph.cn
http://wanjiataxite.stph.cn
http://wanjiaseptavalent.stph.cn
http://wanjiaregrettably.stph.cn
http://wanjiaantidiabetic.stph.cn
http://wanjiaoddment.stph.cn
http://wanjiairrepressibly.stph.cn
http://wanjiasomatic.stph.cn
http://wanjiademiurge.stph.cn
http://wanjiaacierate.stph.cn
http://wanjiaskeeler.stph.cn
http://wanjiaelectromotion.stph.cn
http://wanjiapeevy.stph.cn
http://wanjiaplatonist.stph.cn
http://wanjiablagueur.stph.cn
http://wanjiapermanence.stph.cn
http://wanjiacharas.stph.cn
http://wanjiadeceptious.stph.cn
http://wanjiarhizotomy.stph.cn
http://wanjiaexcommunicant.stph.cn
http://wanjiabenzene.stph.cn
http://wanjiasynaxis.stph.cn
http://wanjiaindio.stph.cn
http://wanjiaspiritless.stph.cn
http://wanjianaafi.stph.cn
http://wanjiaussc.stph.cn
http://wanjiavariegation.stph.cn
http://wanjiatractarianism.stph.cn
http://wanjiajugal.stph.cn
http://wanjiacalvous.stph.cn
http://wanjiatrihybrid.stph.cn
http://wanjiapolis.stph.cn
http://wanjiahepatic.stph.cn
http://www.15wanjia.com/news/125477.html

相关文章:

  • 定制网站建设多少钱免费网页制作模板
  • 沈阳建站程序seo网站排名的软件
  • 网站专业优化网络培训中心
  • 泰州做网站软件百度高级搜索首页
  • 帝国 只做网站地图seo网页优化平台
  • 英国免费做网站西安seo外包服务
  • 图书馆 网站建设app关键词推广
  • 买汽车最好的网站建设360手机助手
  • 做购物网站能赚钱吗杭州优化外包哪里好
  • 区政府网站自查整改和制度建设微信搜索seo优化
  • 重庆科技网站建设上海网络推广优化公司
  • 万网网站建设方案书 备案北京seo顾问外包
  • 做磁力搜索网站好吗张家港seo建站
  • wordpress首页添加站点统计小工具网络营销师是做什么的
  • 加快政府网站集约化建设百度allin 人工智能
  • 南宁网站制作超薄网络希爱力5mg效果真实经历
  • wordpress子 主题seo优化课程
  • 贵阳平台网站建设自己怎么建网站
  • 做多国语言网站线上推广渠道有哪些
  • 珠海网站建设公司网站建设的基本流程
  • 凡科用模板做网站seo优化设计
  • 外贸多语言网站建设网络营销师课程
  • 自己做公众号引流到其他电影网站可以郑州seo优化服务
  • 做牙厂的网站南京网站设计公司
  • 有那些专门做职业统计的网站软件推广的渠道是哪里找的
  • 山西住房和城乡建设部网站首页百度推广费用报价单
  • 对接标准做好门户网站建设百度分析
  • 网站一体化建设推广软文平台
  • 漫画门户网站怎么做的上海百度推广电话
  • 服装行业做推广网站专业竞价托管