client

memcached 客户端编程

微笑、不失礼 提交于 2019-12-10 02:08:15
最近一直在做一个项目的前期设计工作,考虑到后期系统的扩展和性能问题也找了很多解决方法,有一个就是用到了数据库的缓存工具memcached(当然该工具并不仅仅局限于数据库的缓存)。先简单的介绍下什么是memcached。 Memcached是高性能的,分布式的内存对象缓存系统,用于在动态应用中减少数据库负 载,提升访问速度。Memcached由Danga Interactive开发,用于提升LiveJournal.com访问速度的。LJ每秒动态页面访问量几千次,用户700万。Memcached将数 据库负载大幅度降低,更好的分配资源,更快速访问。 上网baidu了很多东西,几乎都差不多,而且基于java的说的很少,所有只有在研究了各个其他语言类的应用后再来尝试在java上进行简单的操作应 用。先从memcached上进行说明,memcached的最新版是采用c语言进行开发和设计的,据说旧版的是采用perl语言开发的,而且它是一个应 用软件来的,是作为缓存服务器的服务器端运行在服务器上的,需要使用特定的语言编写客户端与其进行通信来进行数据的缓存和获取。通常我们是把 memcached安装运行在web服务器上,然后通过对需要的数据进行缓存,据我目前所知,所有数据的缓存设置和存取操作,以及数据的更新后替换操作全 部需要程序来进行,而不是自动进行的(自动不知道能不能成功,呵呵)

How to write multiple slave i2c client device driver?

一笑奈何 提交于 2019-12-10 02:04:16
问题 I am trying to develop a driver for an embedded board. The driver is supposed to open up an interface for v4l2 and communicate with 2 devices using i2c . the driver will act as a master. I can't seem to understand how i2c_device_id array and i2c_add_driver functions work. I read documentation in kernel source but it won't help me on multiple slave clients. Do I have to have two seperate probe functions? Do i have to call i2c_add_driver two times? If not how am I going to be able to save two

Python client - SSL lib - certificate verify failed

扶醉桌前 提交于 2019-12-10 01:45:08
问题 I'm trying to do a small secure HTTPS client for learning purposes and see how all the mechanics of SSL works on a higher level for now, so i'm trying to convert a simple socket into a ssl via ssl.wrap_socket. I probably got the whole concept backwards but, here's what i'm doing: s.connect((host, port)) if port == 443: f = open('cacerts.txt', 'r') calist = f.read() f.close() ca = ssl.get_server_certificate((host, port), ssl_version=ssl.PROTOCOL_SSLv3|ssl.PROTOCOL_TLSv1) if not ca in calist: f

MemcachedClient4J简单介绍

家住魔仙堡 提交于 2019-12-10 01:39:48
算是我第一个开源作品,之前也写过一些半成品,最终没有完成。这是一个使用netty3框架写的mecached客户端,实现mecached ASII协议,性能上超过Spymecached.还有很多特性及扩展有待完善 , 后面会把性能测试报告补上 。这个客户提供同步和异步接口,使用方法很简单,例子如下: MemcachedClient memcachedClient = new MemcachedClient(new String[]{"127.0.0.1:11211" }) ; //sync boolean set1 = memcachedClient.set("key1", "Hi") ; boolean set2 = memcachedClient.set("key2", "Hello") ; Map<String, Object> gets = memcachedClient.gets("key1" ,"key2") ; System.out.println(String.format("set key1 : %s ", set1)); System.out.println(String.format("set key2 : %s ", set2)); System.out.println(String.format("key1: %s", gets.get("key1")));

MemcachedClient4J测试报告

走远了吗. 提交于 2019-12-10 01:32:46
目的 主要是了解 MemcachedClient4J实际性能,对下步优化提供依据 场景 采用跟spymecached对比测试,分别在大负荷的情况下,观察两者性能表现,主要观察指标有耗时和出错率。 测试环境 mecached服务器 数量:1 系统:centos 6.4 cpu:Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz 内存:4G mecached参数:内存512M 客户端 系统:centos 6.4 cpu:Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz 内存:4G jdk:1.6.0_38-b05 Netty : 3.7.0.Final 设置 TCP_NODELAY 为 true io worker 为 cpus 个数 测试结果 结论和分析 MemcahcedClient4J在同样的压力下表现比spymemcached较好,但差距不是很大,这也是我意料之中。memcachedClient4J所使用的netty框架是支持多线程worker,测试只有一个memcached节点,实际上所有读写处理还是由同一个worker线程处理,跟 单线程nio的 spymemcached基本处理同一个等级水平。但是netty对IO写都有一个小优化,通常的NIO写操作都是放入一个缓冲队列,等待reactor去写。在队列为空的情况下

What are the Pitfalls of using a shared static WCF Proxy Client?

醉酒当歌 提交于 2019-12-09 19:15:45
问题 I am considering using a Shared (read static) WCF proxy client for a high throughput application. I believe there is a performance gain in doing this, but I have not benchmarked this as yet. Are there some serious pitfalls to this idea? From my research I can see that there is the issue of handling the fault state, it is not clear what the flow on affect of this state would be to other pending requests. Does anyone have any experience recovering a WCF proxy from it's faulted state? thanks in

java share data between thread

可紊 提交于 2019-12-09 18:32:09
问题 i have a java process that reads data from a socket server. Thus i have a BufferedReader and a PrintWriter object corresponding to that socket. Now in the same java process i have a multithreaded java server that accepts client connections. I want to achieve a functionality where all these clients that i accept can read data from the BufferedReader object that i mentioned above.(so that they can multiplex the data) How do i make these individual client threads read the data from BuffereReader

thrift cpp sample code compile error

坚强是说给别人听的谎言 提交于 2019-12-09 18:08:29
问题 I'm new to Thrift. I think I installed it correctly. I have the folowing libs : luckyan315@ubuntu:~/code/thrift-0.8.0/tutorial/cpp$ ll /usr/local/lib/ total 11496 drwxr-xr-x 4 root root 4096 Mar 23 19:35 ./ drwxr-xr-x 10 root root 4096 Oct 12 22:27 ../ -rwxr-xr-x 1 root root 4100463 Mar 31 20:26 libthrift-0.8.0.so* -rw-r--r-- 1 root root 7256552 Mar 31 20:26 libthrift.a -rwxr-xr-x 1 root root 991 Mar 31 20:26 libthrift.la* lrwxrwxrwx 1 root root 18 Mar 23 19:35 libthrift.so -> libthrift-0.8.0

running an axis2 client version 1.5

坚强是说给别人听的谎言 提交于 2019-12-09 17:54:18
问题 So I'm running out of ideas to try to actually get a client to connect to the SOAP service I'm running through axis2. I tried two methods, one was to use wsdl2java to build the stub and associated client side classes, and then write a Client class that build the requests messages and sends them through the Stub. The other way was to use the ServiceClient to connect.. Both are failing in their own way.. Option #1, every time a message is sent through the stub I get this back: org.apache.axis2