`

Redis, Memcached, Tokyo Tyrant and MySQL comparision

 
阅读更多

Redis, Memcached, Tokyo Tyrant and MySQL comparision

 

I wanted to compare the following DBs, NoSQLs and caching solutions for speed and connections. Tested the following

My test had the following criteria

  • 2 client boxes
  • All clients connecting to the server using Python
  • Used Python’s threads to create concurrency
  • Each thread made 10,000 open-close connections to the server
  • The server was
    • Intel(R) Pentium(R) D CPU 3.00GHz
    • Fedora 10 32bit
    • Intel(R) Pentium(R) D CPU 3.00GHz
    • 2.6.27.38-170.2.113.fc10.i686 #1 SMP
    • 1GB RAM
  • Used a md5 as key and a value that was saved
  • Created an index on the key column of the table
  • Each server had SET and GET requests as a different test at same concurrency

Results please !

Work sheet

throughput set

throughput get

I wanted to simulate a situation where I had 2 servers (clients) serving my code, which connected to the 1 server (memcached, redis, or whatever). Another thing to note was that I used Python as the client in all the tests, definately the tests would give a different output had I used PHP. Again the test was done to check how well the clients could make and break the connections to the server, and I wanted the overall throughput after making and breaking the connections. I did not monitor the response times. I didnt change absolutely any parameters for the servers, eg didn’t change the innodb_buffer_pool_size or key_buffer_size.

MySQL

MySQL lacked the whole scene terribly, I monitored the MySQL server via the MySQL Administrator and found that hardly there were any conncurrent inserts or selects, I could see the unauthenticated users, which meant that the client had connected to MySQL and was doing a handshake using MySQL authentication (using username and password). As you could see I didn’t even perform the 40 and 60 thread tests.

I truncated the table before I swtiched my tests from MyISAM to InnoDB. And always started the tests from lesser threads. My table was as follows

CREATE TABLE `comp_dump` (
  `k` char(32) DEFAULT NULL,
  `v` char(32) DEFAULT NULL,
  KEY `ix_k` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

NoSQL

For Tokyo Tyrant I used a file.tch as the DB, which is a hash database. I also tried MongoDB as u may find if u have opened the worksheet, But the server kept failing or actually the mongod failed after coming at an unhandled Exception. I found something similar over here. I tried 1.0.1, 1.1.3 and the available Nightly build, but all failed and I lost my patience.

Now what

If you need speed just to fetch a data for a given combination or key, Redis is a solution that you need to look at. MySQL can no way compare to Redis and Memcache. If you find Memcache good enough, you may want to look at Tokyo Tyrant as it does a synchronous writes. But you need to check for your application which server/combination suits you the best. In Marathi there is a saying “मेल्या शिवाय स्वर्ग दिसत नाही”, which means “You can’t see heaven without dieing” or need to do your hard work, can’t escape that ;)

I’ve attached the source code used to test, if anybody has any doubts, questions feel free to ask

Attachment Size
throughput-get.png 8.57 KB
throughput-set.png 8.65 KB
worksheet.png 42.36 KB
comparision.tar.gz 7.46 KB
 

    My previous post Redis, Memcache, Tokyp Tyrant, MySQL comparison. The MySQL was taking a huge time for doing a reverse DNS lookup.

    I turned on the skip-name-resolve parameter in the my.cnf and the Throughput of MySQL grew considerably, almost more than double.

    Here are the new results.

    GET

    SET

    worksheet

    MyISAM vs InnoDB

    Nothing much has changed in the above test. Except for the fact InnoDB starts leading the way when there are high number of concurrent Inserts/Updates or Writes on the table. As seen from the “Set” graph InnoDB starts closing for MyISAM’s write efficiency around 30 concurrent requests and then by 60 concurrent requests its already ahead in throughput of writes – 1284/s against 825/s. Further I had put a watch on processlist and was watching the processess, there were times during MyISAM when the inserts took over 6seconds to finish, which also means that if you are in a need of an application which requires quicker response during heavy loads / heavy concurrency… You need to check the MyISAM vs. InnoDB scenario really closely. At low concurrency MyISAM is well ahead in writes, and in Reads, both MyISAM and InnoDB perform equally well.

    Again you need to make sure that you check ur test conditions really well before just taking InnoDB for granted.

    Attachment Size
    throughput-get2.png 7.96 KB
    throughput-set2.png 8.71 KB
    worksheet-2.png 23.31 KB
    comparision.ods 29.02 KB


    转自 :http://aio4s.com/blog/tag/tokyo-tyrant
    分享到:
    评论

    相关推荐

      memcached,mongdb,redis,Tokyo Tyrant的安装和使用

      标题中的“memcached, mongdb, redis, Tokyo Tyrant”都是知名的NoSQL数据库系统,它们在现代互联网应用中被广泛使用。这篇博文很可能是关于如何在操作系统环境下安装和使用这四种数据库的教程。 1. **Memcached**...

      Memcached、Redis、MySQL存储层面试问题

      Memcached、Redis、MySQL存储层面试问题 Memcached 1. Memcached是什么,有什么作用? Memcached是一种免费开源的、基于内存的对象存储系统,可以帮助减少数据库的负载,提高网站的响应速度和可扩展性。 2. ...

      memcached数据完整迁移到redis

      标题 "memcached数据完整迁移到redis" 描述的是一个数据迁移的过程,从使用 memcached 存储的数据转换到使用 redis 存储。这个过程在 IT 领域中是常见的,因为不同的缓存系统有不同的特性和优势。让我们深入探讨这个...

      redis-mongodb-memcached视频教程

      高级分布式数据库教程,nosql,mongodb,redis。非常好的分布式教程!

      分布式缓存 Redis + Memcached 经典面试题!.zip

      Redis 和 Memcached 是其中最常用的两种分布式缓存系统。这里我们将深入探讨 Redis 和 Memcached 的核心概念、优缺点以及在面试中常遇到的经典问题。 1. Redis 简介: Redis 是一个开源的,基于键值对的高性能数据...

      memcached完全剖析ehcache memcached redis 缓存技术总结

      标题“memcached完全剖析ehcache memcached redis 缓存技术总结”表明,这篇内容将深入探讨三种流行的缓存技术——Memcached、Ehcache和Redis。缓存是IT行业中用于提高系统性能的关键技术,尤其是在大数据量和高并发...

      golang(gin)整合mysql,整合redis通用脚手架

      本项目主要探讨的是如何将Gin与MySQL数据库和Redis缓存系统进行整合,构建一个通用的后端脚手架。 首先,我们需要了解Gin框架。Gin基于Martini设计,但性能更优,因为它使用了httprouter,这是一个高性能的路由树,...

      php mysql redis nginx memcached

      标题和描述中提到的"php mysql redis nginx memcached"是一组常见的Web开发技术组合,用于构建高性能、可扩展的Web应用程序。以下是对这些技术的详细解释: 1. PHP(Hypertext Preprocessor):PHP是一种广泛使用的...

      ZendFramework 1 cache for Redis,Memcached

      标题"ZendFramework 1 cache for Redis,Memcached"表明这是一个关于使用 Zend Framework 1 框架来实现缓存功能的教程,重点在于集成和使用 Redis 和 Memcached 这两种流行的数据缓存系统。Zend Framework 是一个广泛...

      save-mysql-redis.py

      save_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql_redis.pysave_mysql...

      memcached&redis;性能测试

      memcached,redis性能测试,内存缓存系统的性能测试;

      TreeNM在linux下的部署(用记访问redis和memcached)

      在Linux环境下部署TreeNM并使用Redis和Memcached进行数据访问,是一项涉及到缓存系统和网络监控软件的技术操作。为了更深入地理解这一过程,我们需要分别了解Redis、Memcached以及TreeNM三个主要技术组件的原理和...

      memcached和redis解决session一致问题相关jar(tomcat-7.0.61)

      memcached和redis解决session一致问题相关jar(tomcat-7.0.61)

      10.1.1 redis相比memcached有哪些优势?.md

      10.1.1 redis相比memcached有哪些优势?

      TreeNMS for Redis, memcached v1.7.5

      **TreeNMS for Redis, memcached v1.7.5** TreeNMS 是一款由 TreeSoft 开发的数据库管理系统,特别针对 Redis 和 memcached 这两种流行的数据存储系统设计。这款工具提供了一种免费且高效的解决方案,用于管理和...

      竞品分析之redis强于memcached_memcached集群

      竞品分析之redis强于memcached redis主从切换 1.redis支持持久化(存盘),memcache只能存在内存中 2.redis的速度比memcached快很多.Redis直接自己构建了VM 机制 ,因为一般的系统调用系统函数的话,会浪费一定的时间去...

      分布式缓存技术-Redis和Memcached选型对比-性能测试

      在众多的缓存解决方案中,Redis和Memcached是最受欢迎的两个选择。本文将深入探讨Redis与Memcached的选型对比,分析它们的性能测试结果,并探讨各自的优缺点。 Redis与Memcached都是基于NoSQL的内存数据结构存储...

    Global site tag (gtag.js) - Google Analytics