Научная статья на тему 'Web service optimization using caching'

Web service optimization using caching Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
118
38
i Надоели баннеры? Вы всегда можете отключить рекламу.
i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Web service optimization using caching»

- вычисления, необходимые для проведения нечеткого вывода, реализованы в конкретных классах-реализациях моделей нечеткого вывода.

Возможность конфигурирования алгоритма нечеткого вывода классом-приемником списка активированных правил позволяет использовать реализацию нечеткого вывода в рамках других алгоритмов, выполняющих различные задачи в процессе автоматизированного построения ИСУ. Реализованная в рамках SCOptimizer архитектура системы нечеткого вывода дала возможность решить ряд инженерных задач, возникших при разработке программного комплекса. Высокая эффективность проектных решений позволила создать систему проектирования ИСУ, превосходящую аналогичный инструментарий МатЛаб [1], что подтверждается результатами тестирования.

Литература

1. Ульянов С.В., Литвинцева Л.В., Добрынин В.Н., Мишин А.А. Интеллектуальное робастное управление: Технологии мягких вычислений. М.: ВНИИгеосистем, 2011. 408 с.

2. Сорокин С.В., Литвинцева Л.В., Ульянов С.В. Технология интеллектуальных мягких вычислений в проектировании

робастных нечетких систем управления: оптимизатор баз знаний // Нечеткие системы и мягкие вычисления. Тверь: ТвГУ, 2008. Т. 3. № 1.

3. Гамма Э., Хелм Р., Джонсон Р., Влиссидес Д. Приемы объектно-ориентированного проектирования. Паттерны проектирования. СПб: Питер, 2008. 366 с.

4. Ульянов С.В., Мишин А.А., Миногин А.А. [и др.]. Информационная технология проектирования робастных баз знаний нечетких регуляторов. Ч. III: Квантовый нечеткий вывод и квантовая информация // Электрон. журн. Системный анализ в науке и образовании. 2010. N° 3. URL: http://www.sanse.ru/ (дата обращения: 21.12.2012).

References

1. Ulyanov S.V., Litvintseva L.V., Dobrynin V.N., Mi-shin A.A. [Intelligent robust control: Soft computing technology], Moscow, VNIIgeosystem, 2011, 408 p.

2. Sorokin S.V., Litvintseva L.V., Ulyanov S.V., Fuzzy systems and Soft Computing, Tver, Tverskoy Gos. Univ., 2008, Vol. 3, no. 1.

3. Gamma E., Helm R., Johnson R., Vlissides J., Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley Professional, 1st ed., 1994.

4. Ulyanov S., Mishin A., Minogin A., Nefedov N., Pet-rov S., Polunin A., Reshetnikov A., System analysis in science and education, 2010, no. 3, Available at: http://www.sanse.ru/ (accessed 21 Dec. 2012).

WEB SERVICE OPTIMIZATION USING CACHING

Melnikov I.I., Postgraduate; Demidenkov K.A., Postgraduate; Evseenko I.A., Ph.D, Associate Professor (Belarusian-Russian University, 43, Mira Av., Mogilev, 212005, Belarus, [email protected], [email protected], [email protected])

The paper describes a method for accelerating network data transfer through combination of caching, selective compression and encryption and a WAN-accelerator based on this method. The accelerator contains a client part and a server part. It encapsulates the data channel and caches data on the client and server side. Special hashes are used to synchronize cached data on the client and server side. If some data cached on the client side and some data cached on the server side are the same, a response will be extracted from client cache and won't be waited from the server. Data can be quickly and effectively compressed by the methods of selective compression used in the accelerator if necessary. The WAN-accelerator encrypts data to improve data transfer security. WAN-accelerator server part cache asynchronous update helps to cut latency time of a response from a web-service caused by computational complexity and transaction time. Usage of the accelerator can be an effective solution for the problem of client application speed acceleration when a client application requires permanent communication with a web-service. The WAN-accelerator is an independent program module that doesn't require integration with an existing web-service and its modification. It is transparent for a web-service and a client application. Especially it is useful for an organization that has a host system for data processing and management that contains one or more servers with data access through web-services and many clients on a great distance from them.

Keywords: WAN-accelerator, web service, caching, compression, encryption, hash, optimization.

Network technologies have become essential part of the contemporary society. Thanks to which long distance data transfer is not a great problem any more and Internet global network helped to develop communication links that unite all countries in the world. Yet, many of data transfer technologies and involved protocols, e.g. TCP\IP, were designed a long time ago. And today they cannot keep pace with tremen-

dously increased traffic [1]. Therefore, optimization of IP-traffic presents quite relevant current problem. Optimization can be done on software or hardware level.

The simplest way is to upgrade network equipment and expanding of information channel, however, this method is quit expensive. Therefore, all over the world they actively develop alternative approaches re-

lating to improvement of efficiency of existing data channels. For this purpose they use cashing, compression, special connection parameter settings [1, 2], etc.

There are many large companies in Republic of Belarus that have their own local networks, which provide data exchange between work stations and servers with centralized databases. And in general, the data is transferred in uncompressed form. Therefore, data transfer from servers to workstations and back can be significantly increaseB in case, when workstations are located outside of local network, e. g. in a service center in other region. Today, some of Belarus companies actively build up or begin to develop service centers abroad. Atlant and MAZ companies can serve as a perfect example. As they intensively develop new markets, their service centers shall exist in many parts of the world. In order to maintain continuous communication with the head office and have an access to centralized data storage, they need reliable communication technologies. Such technology is presented in web services that are identified by the web address software systems, located on the server side that allow accepting requests from client applications on remote workstations, to process them, generate a response and send it back.

There are many technologies today for creation a reliable and secure web services. For example, Windows Communication Foundation technology (WCF) [3]. However, some Belarusian enterprises have recently started to master foreign sales markets and at that time had already old but good working systems of information processing and transmission. For example, the textile enterprise OJSC «MOGOTEX» has developed and smoothly running data storage system based on the FoxPro and simple web services for data transfer to client applications. The data laggings have dramatically increased with distance rise of clients from servers. The main reason is in the compression deficiency and data caching that represent requests and responses based on SOAP Protocol (in other words, large amounts of uncompressed textual information). To solve this problem the WAN accelerator (Wide Area Network accelerator) has been developed that represents an independent software module.

The proposed Accelerator is an easy in installation and maintenance, as presents the software system specifically designed to speed up web services unlike the complex existing and expensive WAN accelerators, designed to optimize IP traffic [4-6].

It uses compression and encryption algorithms (data encryption) approving oneself, and offers an original approach to prevent often-repeated responses from the server to the client by returning a response directly from the client cache, unless there is a clear need to update it. The using of this accelerator will allow avoiding the heavy expenses, associated with modifying existing web services to accelerate the data

transfer by the net, especially by unstable channels or channels with low capacity.

The architecture of web service accelerator

The architecture of the development accelerator is presented in Picture 1. It can operate in two modes: in server and client mode. Operating in server mode, the accelerator is designed for listening through requests and processing from the same one, but is running in client mode. Therefore, operating in client mode, the accelerator is designed for sending requests and receiving responses from the same one, but running in server mode. The accelerator must be installed on both the custom application and the web service, and configured to intercept HTTP-requests from the client application to the web service over a TCP channel, producing operations of caching, compression and encryption. Therefore, the proposed accelerator is a transmission media. For simplicity, let's call the accelerator, operating in server mode, the accelerator server and the accelerator, operating in client mode, the accelerator client. This architecture is well-used to speed up client applications, operating with synchronous requests to web services that do not include compression and data encryption mechanisms.

Accelerator client is used as the proxy server. It intercepts requests sending by the client application to web service, processes them in a certain way and forwards to accelerator server. Accelerator server accepts requests from accelerator client and processes them in a certain way, and then sends to the next web service. The TCP-connection is established between the accelerator client and accelerator server. One or more accelerator clients can be connected to one accelerator server. Data is transmitted by TCP-channel in encrypted form. Encryption is completed by the accelerator. How can the accelerator, that is presented as the mediator, speed up the data transfer by the network? Let's consider the key techniques in more detail.

Network acceleration of data transfer by caching

There are a number of well-proven and widely used methods of IP-traffic optimization. One of such methods is caching, i.e. the storage of frequently used

HTTP-reguest

Custom

application HTTP-response Web service

Key technologies r Client-server caching > Data compression over a TCP channel V Data coding over a TCP channel

Picture 1. The architecture of web services Accelerator

information in one location where you can quickly and easily retrieve it, when you need. For example, such capability is used in web browsers that will not allow you to download the whole content again of requested web page from a remote server, but only some updated information. Either, if many clients log onto the internet through one server computer that has a direct connection to this network, using special tools, you can cache information about queries for all users, without tugging it every time from the remote computer but from the memory of the server [6]. You can also use the intermediate servers to cache information that will be much faster generally, than if you will be request the same data repeatedly from a remote server, as implemented in the Google Global Cache technology.

The feature of the proposed solution is that the accelerator client and accelerator server will be having

its own cache, i.e. data caching will be implemented on both the client and server.

In interception of HTTP-request from the client application by the accelerator client, a permanent unique key is formed that is generated by hashing a string of the URI request and, if it is a POST-request of its body, and also the temporary unique key generated randomly. The copy of the request under the temporary key is placed in cache of the accelerator client, and the request itself is sent to the next accelerator server. Accelerator server receives the request,

places its copy to own cache under the temporary key that, in general, does not match the corresponding key on the client, and determines the permanent key, which will be coincided with the same key on the client and sends the query to web service. Web service generates the response that gets the accelerator server at first. The latest one on the basis of the response body, determines a hash-code, then places this code and a response copy in cache, associating it with the cached request, assigns the permanent key (temporary key is removed) to the request-response pair and sends response to accelerator client that performs the same operation, sending the answer to the client application. Thus, each query and the answer are cached twice, on both the client and server. General schemes of operation algorithms of accelerator client and accelerator server are shown in the pictures 2 and 3 respectively.

In the case of interception by the accelerator client of a new request, the latest determines the hash code by the rule described above and searches that query by the permanent key in its cache. If a request-response pair with the identical hash code (the identical permanent key) is found in the cache, the accelerator client sends this hash code to accelerator server. It is searching for a pair of request-response in its cache by receiving the hash code of the request. If such pair exists, the accelerator server sends back a hash code response. Accelerator client receives the hash code of

Picture 2. Operation algorithm of accelerator client

Picture 3. Operation algorithm of the accelerator server

the response and compares with the same code in its cache. If the codes are the same, it means that the answer has not changed on the server, so the accelerator client sets back the response to the end customer from its own cache. After sending the hash code the accelerator server immediately sends a query that is in its own cache, to web service to update the appropriate response. In other words, the accelerator server asynchronously updates its own cache, so that the data will be more relevant.

In the case of the repeated interception by accelerator client of identical query, the hash code response that is stored in its own cache and the hash code of an updated response that is stored in the cache of accelerator server may vary. This will entail the transfer request from the accelerate client to the accelerator server to update the response in the cache of accelerator client and return it to a more current version to the custom application. Accelerator server will send a response from its own cache, and then sends the query to web service to update the response again.

Such architecture and operation scheme of the accelerator will significantly allow speeding up the process of data transfer in the case of frequent repetition of identical client requests, to which the answers are received and which content is not updated very often, or not updated at all. The cash asynchronous update of accelerator server can significantly reduce the interruptions in waiting for a response by the client due to length of query processing by web service (for example, fetching from a large data array, performing complex calculations, etc.). The temporary keys

would allow avoiding the conflicts if both cases by receiving identical requests from some clients in accelerator client or some accelerator clients in accelerator server.

The obvious disadvantage of such scheme is the storage of irrelevant data on the side of accelerator server. The independent asynchronous cache update of accelerator server can help to reduce this probability through specify periods in time where each query has its own timer to avoid significant increases in load to the web service, if the whole cache would be updated at the same time.

Expedition of data transfer over a network by means of discriminating compression

As it was noted earlier, some enterprises, with its old but well-designed and workable systems where custom applications must constantly communicate with a central server, while the data is transmitted in uncompressed form, encountered with some difficulties by extending such system and the establishment of client applications with servers not by local network but on the Internet. For lack of data compression, transmission time may significantly increase, especially by unstable channel. Therefore, the accelerator has the ability to compress the data passing through it in order to increase the speed of their transfer.

The key point is how to make the most effective use of existing data compression algorithms. Experiments were carried out by using the proposed accelerator showed that the compression the data packet size by 32 bytes is pointless, because it leads to its rise, while 512 bytes is not appropriate, since the time of compression cannot be comparable over time the packet. Therefore, 512 bytes is the minimum packet size, which should be a compression algorithm.

In addition, the term assumes the using of adaptive packets compression, the essence of which concludes in depending by the data type to select the best compression algorithm [7].

Conclusion

The proposed program module can be useful, first of all to enterprises with a centralized processing and management information systems, which are composed of one or more servers that provide access to information through web services, and many customers located at a great distance from the server (servers). The usage and combination of caching, compression and encryption, allow you to make data transfer faster.

The WAN accelerator is not a generalized facility. The efficiency of its usage in situations of very frequent data updates for responses on server, as well as audio and video transmission by the network, is not great. Its usage is practical in the case of necessity of work intensification of the customs applications that require frequent synchronous requests to web services

that transmit data by uncompressed SOAP-based protocol.

References

1. Sedykh С., Available at: http://www.setevoi.ru/cgi-bin/ text.pl/magazines/2000/1/64 (accessed 11 Oct. 2012).

2. Introduction to WAN Optimization, Available at: http:// www.excitingip.com/459/introduction-to-wan-optimization-techni-ques/ (accessed 11 Oct. 2012).

3. Troelsen A., Pro C# and the .NET 4 Platform, 5th ed., NY, Springer-Verlag, 2010, 1752 p.

4. Optimize WAN and LAN Application Performance with TCP Express, Available at: http://www.f5.com/pdi/white-papers/ tcpexpress-wp.pdf (accessed 11 Oct. 2012).

5. WAN Optimization, Available at: http://www.riverbed. com/us/solutions/wan_optimization/ (accessed 11 Oct. 2012).

6. WinGate: The Comprehensive Internet Management Solution for Windows, Available at: http://www.redline-software.com/ eng/support/docs/wingate/ (accessed 11 Oct. 2012).

7. Vorobyov I., Storage News, 2008, no. 2 (35), pp. 24-27.

Версия статьи на русском языке

УДК 621.397:004.738

ОПТИМИЗАЦИЯ РАБОТЫ WEB-СЕРВИСОВ ПУТЕМ КЭШИРОВАНИЯ ДАННЫХ

И.И. Мельников, аспирант; К.А. Демиденков, аспирант; И.А. Евсеенко, к.т.н., доцент (Белорусско-Российский университет, просп.. Мира, 43, г. Могилев, 212005, Беларусь, [email protected], [email protected], [email protected])

Предложены метод ускорения передачи данных по сети путем сочетания механизмов кэширования, кодирования и избирательной компрессии данных, а также WAN-акселератор на его базе. Особенностью архитектуры акселератора является то, что он имеет клиентскую и серверную части, управляя процессом передачи информации по сети и осуществляя кэширование данных на стороне клиента и на стороне сервера. Для синхронизации кэшированных данных, хранящихся на стороне клиента и на стороне сервера, используются хеш-коды, вычисленные по определенным правилам. Если данные совпадают, ответ на повторный запрос, не дожидаясь ответа от сервера, извлекается прямо из кэша клиента. Методы избирательной компрессии, также применяемые в акселераторе, позволяют быстро и эффективно сжимать передаваемые данные в случае необходимости. Для повышения безопасности передачи данные кодируются посредством самого WAN-акселератора. Асинхронное обновление кэша на серверной стороне WAN-акселератора позволит сократить время ожидания клиентом ответа от web-сервиса, связанного с вычислительной сложностью или временем обработки запроса. Применение данного акселератора может стать эффективным решением проблемы ускорения работы клиентских приложений, требующих постоянного обмена информацией с web-сервисами. WAN-акселератор представляет собой независимый программный модуль, не требующий интеграции с существующими web-сервисами и их модификации. Он прозрачен как для web-сервиса, так и для клиентского приложения. Особенно полезен он для предприятий, имеющих централизованные системы обработки и управления информацией, в состав которых входят один или несколько серверов, предоставляющих доступ к информации посредством web-сервисов, и множество клиентов, находящихся на большом расстоянии от сервера (серверов).

Ключевые слова: WAN-акселератор, web-сервис, кэширование, компрессия, кодирование, хеш-код, оптимизация.

WEB SERVICE OPTIMIZATION USING CACHING Melnikov I.I., Postgraduate; DemidenkovK.A., Postgraduate; Evseenko I.A., Ph.D., Associate Professor (Belarusian-Russian University, 43, Mira Av., Mogilev, 212005, Belarus, [email protected], [email protected], [email protected]) Abstract. The paper describes a method for accelerating network data transfer through combination of caching, selective compression and encryption and a WAN-accelerator based on this method. The accelerator contains a client part and a server part. It encapsulates the data channel and caches data on the client and server side. Special hashes are used to synchronize cached data on the client and server side. If some data cached on the client side and some data cached on the server side are same, a response will be extracted from client cache and won't be waited from the server. Data can be quickly and effectively

i Надоели баннеры? Вы всегда можете отключить рекламу.