REST(Representational State Transfer)是 Roy Fielding 提出的一个描述互联系统架构风格的名词。 Another way to say REST is in HTTP, any request a client can make involves a URL and an HTTP method. With REST, the URL is designed to represent a noun and the HTTP method always maps to one of several standard verbs, which will be performed against that noun.In summary, each HTTP method will cause a well-defined action on the resource represented by the URL it operates on. The methods can be compared to SQL commands: GET is like "SELECT," DELETE is like "DELETE," POST is like "INSERT" with an auto-generated ID, and PUT is like "INSERT OR UPDATE IF EXISTS" with an ID specified. REST 指的是一组架构约束条件和原则。满足这些约束条件和原则的应用程序或设计就是 RESTful. stateless 有利于scalabilty,cluster 客户端可用cache提高性能 分层 这表示组件无法了解它与之交互的中间层以外的组件,这是博士论文中提到的,不是很理解 Get/Put/Delete方法的幂等性 Security 与SOAP架构相比,REST架构的优点是: SOAP接口隐藏在SOAP Envelope中了,对外暴露的是相同的URL(对于同一个web service), 不利于代理服务器根据HTTP method做安全控制, 除非解析SOAP Envelope 内容。 SOAP 采用HTTP Post也不利于浏览器做cache
以下两个是同一个时间: UTC, Coordinated Universal Time (UTC), use time zone of GMT GMT, Greenwich Mean Time 标准时间 18:00 GMT = 18:00+00:00 在用java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ"); 格式化时间时: Z表示的时间格式是+00:00 z表示的时间格式是UTC
http://publib.boulder.ibm.com/infocenter/imshelp1/v3r0/index.jsp?topic=/com.ibm.wspac6.doc/satsinst.html Shorten the temp directory used by WebSphere® Portal Server (WPS), following the steps described below: Create a directory with a short name on the C drive, for example, C:\tmp. Start the WebSphere Portal Server V6.0, and using the WAS Administrative Console, navigate to the servers Application Servers > Portal server(注意此处是portal server, 而不是app server,否则无效) > Java™ and Process Management > Process Definition > Java Virtual Machine page. In the Generic JVM arguments, fill in: -Dworkspace.user.root=C:\tmp Save and re-start the WebSphere Portal Server。When the server restarts, it will then use the C:\tmp directory as the WebSphere Portal Server temp directory. This fixes the problem. 好像IBM有Pack针对这个问题,以上的可以作为一个workaround. 在以下WAS/WPS测试通过。 IBM WebSphere Application Server - ND, 6.0.2.9 Build Number: cf90614.22 Build Date: 4/7/06
为了查看Eclipse GC log,需要在eclipse.ini 中加入 -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -verbose:gc -Xloggc:gc.log 在Eclipse安装目录查看gc.log 9.768: [Full GC 9.769: [Tenured: 7678K->9025K(27328K), 0.3117731 secs] 9172K->9025K(39616K), [Perm : 16383K->16383K(16384K)], 0.3122537 secs] 从上面的日志看似有perm 区(16384K)满引起的Full GC, 需要增大perm区空间和初始空间 -XX:PermSize=64m -XX:MaxPermSize=64m 再重启Eclipse有如下log 1.338: [GC 1.338: [DefNew: 10944K->1028K(12288K), 0.0223470 secs] 10944K->1028K(39616K), 0.0224436 secs] [Times: user=0.03 sys=0.00, real=0.03 secs] 2.053: [GC 2.053: [DefNew: 11972K->434K(12288K), 0.0159322 secs] 11972K->1431K(39616K), 0.0161071 secs] [Times: user=0.01 sys=0.00, real=0.02 secs] 2.923: [GC 2.923: [DefNew: 11378K->1048K(12288K), 0.0192125 secs] 12375K->2044K(39616K), 0.0193916 secs] 貌似初始yong 区空间小了引起yong GC,让初始堆空间跟最大堆空间一样大(yong区应该也会按比例增大吧),GC消除了。 最终eclipse.ini如下 -startup plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222 -product org.eclipse.epp.package.java.product --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms384m -Xmx384m -XX:PermSize=64m -XX:MaxPermSize=64m -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -verbose:gc -Xloggc:gc.log 有趣的是关掉Eclipse会看到如下的log 20.639: [GC 20.639: [DefNew: 104960K->12258K(118016K), 0.2109056 secs] 104960K->12258K(380160K), 0.2110277 secs] [Times: user=0.20 sys=0.00, real=0.20 secs] 31.909: [GC 31.909: [DefNew: 117218K->7351K(118016K), 0.2577353 secs] 117218K->19392K(380160K), 0.2578431 secs] [Times: user=0.24 sys=0.00, real=0.25 secs] Heap def new generation total 118016K, used 37344K [0x02b00000, 0x0ab00000, 0x0ab00000) eden space 104960K, 28% used [0x02b00000, 0x0484a4c0, 0x09180000) from space 13056K, 56% used [0x09180000, 0x098add90, 0x09e40000) to space 13056K, 0% used [0x09e40000, 0x09e40000, 0x0ab00000) tenured generation total 262144K, used 12041K [0x0ab00000, 0x1ab00000, 0x1ab00000) the space 262144K, 4% used [0x0ab00000, 0x0b6c25c0, 0x0b6c2600, 0x1ab00000) compacting perm gen total 65536K, used 36982K [0x1ab00000, 0x1eb00000, 0x1eb00000) the space 65536K, 56% used [0x1ab00000, 0x1cf1d8e0, 0x1cf1da00, 0x1eb00000) No shared spaces configured. 是什么触发了yong GC?关Eclipse时需要创建对象引起GC释放更多的对象? Yong 区空间118016K + tenured 空间262144K = 380160K, 这约等于我们Xms/Xmx设置的空间。所以xms/xmx大小不包括perm区空间
Sharding(Shared Nothing), 实现scale out的一种方式。其主要目的是为突破单节点数据库服务器的I/O能力限制,解决数据库扩展性问题。适用用业务逻辑上独立的数据,bloger,digger上单个user的数据。Shard可以根据ID,时间段,表来划分。 如果结果涉及多个shard,可以在应用层抽象出一个数据库操作接口,对从多个shard取回的结果进行merge, sort之类的操作。
磁盘IO问题,解决方法之一是cache 比如在应用服务器和数据库之间加入memcached.磁盘IO主要原因之一是大量文件读写操作,比如图片,音频,视频的读写。不管是直接从文件还是从数据库,都会造成大量的IO Web Server前(如Apache Server)加入squid(Reverse Proxy) 我是这么理解的:Forward Proxy配在客户浏览器端,如局域网通过这种代理上网Reverse Proxy配在Web Server端,作为cache. 可不可以作为Redirect /load balance 不是很确定。 IBM Edge Server应该属于此类。
InnoDB和MyISAM是在使用MySQL最常用的两个表类型,各有优缺点,视具体应用而定。基本的差别为: MyISAM类型不支持事务处理等高级处理,而InnoDB类型支持。 MyISAM类型的表强调的是性能,其执行数度比InnoDB类型更快,但是不提供事务支持,而InnoDB提供事务支持以及外部键等高级数据库功能。
portlet request divide into action request and render request Render parameters allow the portlet to store its navigational state. Render parameters stay the same for subsequent render requests and only change when the portlet receives a new action. This enables bookmarkability and solves the browser back button problem. portlet request: a call from from the client (portal server) to process some information or render some markup. A portlet request is received and managed by a portlet container. The portlet container executes the targeted portlet to process the request. There are two things that distinguish portlet requests from typical http (web requests): the client sending the portlet request is a portal application not an end user (browser) and multiple (two) requests are sent to submit data and render a markup response. portlet request scope: the duration of a request processed by the portlet container. Because portlets separate action processing and rendering in two distinct requests, client state stored in the request scope does not carry forward from a portlet's action to its render. JSF Bridge As Faces executes in the context of an underlying container its request scope is restricted by that provided by the container. However, the Faces model is based on the servlet model and hence expects a single request for processing both user interactions and rendering. Because this isn't the behavior in a portlet container, Faces does not execute properly if the Faces application depends on request scoped data established during action processing and referenced during rendering. the bridge preserves data stored at request scope so that it can be restored on subsequent render requests. I.e. where in a regular portlet environment, each action and render request processing starts with an empty data set in its request scope and any data added to this scope during processing is destroyed when the request completes, the bridge preserves this state and restores it into the request scope on subsequent render requests.