US8090769B2 - Dynamically generating web contents - Google Patents
Dynamically generating web contents Download PDFInfo
- Publication number
- US8090769B2 US8090769B2 US12/336,230 US33623008A US8090769B2 US 8090769 B2 US8090769 B2 US 8090769B2 US 33623008 A US33623008 A US 33623008A US 8090769 B2 US8090769 B2 US 8090769B2
- Authority
- US
- United States
- Prior art keywords
- file
- specific file
- application execution
- http
- execution unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active, expires
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Definitions
- the present invention relates to a server that provides web contents on a network, and in particular, relates to a server that dynamically generates and provides web contents.
- a web application server for dynamically generating web contents is configured of an HTTP (HyperText Transfer Protocol) server as the front end, and a programming language processor (referred to as “application execution unit” below) as the back end.
- HTTP HyperText Transfer Protocol
- application execution unit a programming language processor
- An approach to connect these two components to each other includes FastCGI and mod_php.
- Faster FastCGI for example, to implement Fast CGI as an SAPI (for example, see “lighty's life Faster Fast CGI”, [online], 29 Nov. 2006 lighty's life, [searched on 29 Feb. 2008], the Internet ⁇ URL: //blog.lighttpd.net/articles/2006/11/29/faster-fastcgi>).
- This approach is implemented by lighttpd 1.5 beta in an HTTP server.
- a PHP processor writes an execution result out to a file assigned to a shared memory (/dev/shm), and passes its file name as an HTTP header (X-LIGHTTPD-tempfile) in the FastCGI protocol.
- a FastCGI module (mod-php) of the HTTP server transmits a message by use of a sendfile system call of the operating system (OS).
- OS operating system
- a web application server as described above carries out a series of operations: receiving a request from a client (HTTP client); generating an HTML (Hypertext Markup Language) file in response to the request; and returning the generated HTML file to the client, for example.
- processing is executed while shifted between the HTTP server and an application execution unit, accompanied by memory copying repeatedly performed between a user space (user memory) and a kernel space (kernel memory) in the memory.
- necessary data is read from a storage device, and is also copied together with the data in the memory.
- This memory copying operation requires a specific processing cost. Hence, repetition of redundant memory copying leads to performance degradation of the web application server as a whole.
- a server that generates an HTML file upon receipt of an HTTP request comprises a processor, a memory coupled to the processor, an application execution unit configured to generate the HTML file based on the HTTP request, an HTTP server configured to receive the HTTP request and return an HTTP response to the HTTP request, the HTTP response including the HTML file generated by the application execution unit.
- the application execution unit is configured to execute a script in generating the HTML file; and generate an object constituting the HTML file without reading a specific file if an instruction code of the script corresponds to the specific file and does not request modification to contents of the specific file.
- the generated object contains a link to the specific file, which is accessible by the HTTP server.
- the HTTP server transmits the specific file together with the HTML file, wherein an un-updated file is transmitted by a link name, and an updated file is transmitted by an original file name.
- a server that generates an HTML file upon receipt of an HTTP request comprises a processor, a memory coupled to the processor, an application execution unit configured to generate the HTML file based on the HTTP request, and an HTTP server configured to receive the HTTP request and return an HTTP response to the HTTP request, the HTTP response including the HTML file generated by the application execution unit.
- the HTTP response is transmitted without a copy to user memory.
- the application execution unit executes a script in generating the HTML file; and writes, if an instruction code of the script is an instruction code to display contents of the specific file held in a storage device, information specifying a path to a specific file in an object without reading the specific file. If the HTML file generated by the application execution unit includes the object in which the information specifying the file is written, the HTTP server identifies the specific file on a basis of the information and transmits the file together with the HTML file.
- the application execution unit if a writing operation is performed on the file before the transmission of the file by the HTTP server, the application execution unit generates and retains a copy of the file on which the writing operation has not yet been performed. Then, the HTTP server transmits the file on which the writing operation has not yet been performed.
- the application execution unit generates a copy when the writing operation is performed on the file, by use of a hard link having a Copy-on-write function implemented in an OS.
- the application execution unit locks the file, generates a hard link to a copy of the file, monitors writing to the file, actually generates the copy when a writing operation is carried out, and unlocks the file after transmitting the copy to the HTTP server.
- an instruction code of the script is an instruction code for a file other than the instruction code to display contents of a file, and if contents of the file are to be changed, the application execution unit reads the file, performs processing and generates an object.
- a method for generating an HTML file upon receipt of an HTTP request comprises executing, based on the HTTP request, a script for generating the HTML file, and if an instruction code of the script corresponds to a specific file and does not request modification to contents of the specific file, performing processing to generate an object without reading the specific file, wherein the generated object contains a link to the specific file handling file processing by a dedicated character string object, reading, by an HTTP server, the generated object, in response to reading the generated object, directly loading the specific file to a socket buffer for transmission provided in a kernel space of a memory, if the instruction code requests transmission of the specific file; and transmitting the generated HTML file together with the specific file loaded to the socket buffer as an HTTP response.
- a program product including a non-transitory storage medium readable by a media drive and including instructions for causing a computer to function as application execution means for generating an HTML file based on an HTTP request, and an HTTP server for receiving the HTTP request and returning an HTTP response to the HTTP request, the HTTP response including the HTML file generated by the application execution means.
- the HTTP request is received by the HTTP server without receiving the HTML file.
- the application execution means executes a script in generating the HTML file, and performs, if an instruction code of the script corresponds to a specific file and does not request modification to contents of the specific file, processing to generate an object having a path to the specific file without reading the specific file. With respect to the obiect generated by the application execution means through the processing without reading the specific file, if the original instruction code requests transmission of the specific file, the HTTP server transmits the specific file together with the HTML file generated by the application execution means.
- FIG. 1 is a diagram illustrating a functional configuration of a web application server of this embodiment.
- FIG. 2 is a diagram illustrating a hardware configuration example of a computer to which the embodiment is applied.
- FIG. 3 is a diagram illustrating an exemplar PHP script used in the embodiment.
- FIG. 4 is a flowchart illustrating operations of an application execution unit carried out by an extension library of the embodiment.
- FIG. 5 is a flowchart illustrating operations of the application execution unit carried out by a runtime of the embodiment.
- FIG. 6 is a diagram illustrating a configuration example of a FastCGI packet in the embodiment.
- FIG. 7 is a flowchart illustrating operations of data processing by an HTTP server of the embodiment, at the time of transmitting an HTML file.
- FIG. 8 is a diagram illustrating a state of memory copying in operation of a web application server of the embodiment.
- FIG. 9 is a diagram illustrating a state of memory copying in operation of a conventional web application server.
- FIG. 10 is a chart for comparing the cost of time for memory copying between this embodiment and the conventional case.
- FIG. 1 is a diagram illustrating a functional configuration of a web application server of this embodiment.
- a web application server 100 shown in FIG. 1 can be implemented by a computer such as personal computer, and may include an HTTP server 110 , an application execution unit 120 , an OS execution unit 130 and a storage device 140 .
- the web application server 100 may also be connected to a client 200 through a network.
- PHP Hypertext Preprocessor
- SAPI communication channel between the HTTP server 110 and the application execution unit 120 .
- the application execution unit 120 includes an ordinary PHP runtime library (simply referred to as “runtime” below) 121 and an extension library 122 having an extended function in this embodiment.
- FIG. 2 is a diagram illustrating a hardware configuration example of a computer to which the embodiment is applied.
- a computer 10 shown in FIG. 2 may include a central processing unit (CPU) 10 a which is calculating means, and a main memory 10 c and magnetic disk device (HDD: Hard Disk Drive) 10 g which are storage means.
- the computer 10 may also include a network interface card 10 f for connection to an external device through a network, a video card 10 d and a display 10 j for displaying, and an audio mechanism 10 h for audio output.
- the computer 10 may include input devices 10 i such as a keyboard and a mouse.
- the main memory 10 c and the video card 10 d are connected to the CPU 10 a through a system controller 10 b.
- the network interface card 10 f, the magnetic disk device 10 g, the audio mechanism 10 h and input devices 10 i may be connected to the system controller 10 b through an I/O controller 10 e.
- Each component can be connected by various buses such as a system bus and an input/output bus.
- the CPU 10 a and the main memory 10 c may be connected by a system bus or a memory bus.
- the CPU 10 a and any of the magnetic disk device 10 g, the network interface card 10 f, the video card 10 d, the audio mechanism 10 h and the input devices 10 i are connected by an input/output bus such as Peripheral Components Interconnect (PCI), PCI Express, serial AT Attachment (ATA), Universal Serial Bus (USB), and Accelerated Graphics Port (AGP).
- PCI Peripheral Components Interconnect
- PCI Express PCI Express
- ATA serial AT Attachment
- USB Universal Serial Bus
- AGP Accelerated Graphics Port
- FIG. 2 merely shows an exemplar hardware configuration of a computer to which this embodiment is preferably applied, and an actual server is not limited to the illustrated configuration, as a matter of course.
- a video memory alone may be installed so that image data is processed by the CPU 10 a.
- the audio mechanism 10 h may be included as a function of a chip set constituting the system controller 10 b or the I/O controller 10 e .
- a drive for media such as various optical disks and a flexible disk may be provided, in addition to the magnetic disk device 10 g.
- a liquid crystal display is mainly used as the display 10 j, a display employing any displaying system such as a CRT display and a plasma display may be used.
- each of the functions of the HTTP server 110 , the application execution unit 120 and the OS execution unit 130 may be implemented by the CPU 10 a executing a program loaded to the main memory 10 c, in the computer shown in FIG. 2 , for example.
- the storage device 140 can be implemented by the magnetic disk device 10 g.
- the user memory used by an application and the kernel memory used by the OS can be implemented by the main memory 10 c.
- the HTTP server 110 is a server which operates on the OS to perform HTTP communication through the network, and which receives an HTTP request from the client 200 to forward it to the application execution unit 120 . Then, the HTTP server 110 returns a process result received from the application execution unit 120 to the client 200 , as an HTTP response.
- the HTTP request received from the client 200 is first stored in a socket buffer of the kernel memory, and then is loaded to the user memory used by an application of the HTTP server 110 .
- the response may firstly be stored in the socket buffer of the kernel memory, and may then be transmitted to the client 200 .
- the HTTP server 110 of this embodiment may carry out processing corresponding to an extended function assigned to the application execution unit 120 . Details of this function will be described later.
- the application execution unit 120 is a PHP processor operating on the OS, and may dynamically generate an HTML file by use of the runtime 121 and the extension library 122 , in response to an HTTP request received by the HTTP server 110 .
- the web application server 100 holds original HTML files from which each specific HTML file to respond to an HTTP request is generated. Each of these original HTML files includes a PHP script that may be executed in response to an HTTP request. This PHP script may be executed by the application execution unit 120 , and thereby an object (web object) is generated. Then, a specific HTML file corresponding to the HTTP request may be dynamically generated by embedding the generated object in the original HTML file.
- the application execution unit 120 includes the runtime 121 and the extension library 122 .
- the runtime 121 is an ordinary runtime library for executing a PHP script.
- a function for reducing the load of memory copying is also provided by the runtime 121 .
- the extension library 122 (referred to as “extension” in PHP) may provide an auxiliary function used in the mechanism for reducing the load of memory copying in this embodiment. Details of operations of the application execution unit 120 using the libraries and the functions thereof will be described later.
- the OS execution unit 130 executes the OS, and provides basic functions of the web application server 100 .
- the HTTP server 110 and the application execution unit 120 operate on this OS.
- multiple OS execution units 130 are shown so as to respectively correspond to the HTTP server 110 and the application execution unit 120 in FIG. 1 .
- the HTTP server 110 and the application execution unit 120 operate on the same OS.
- the storage device 140 holds original HTML files from which the application execution unit 120 may dynamically generate each specific HTML file.
- the storage device 140 also holds predetermined data.
- the data is written to an HTML file generated by the application execution unit 120 .
- the function provided by the extension library 122 of the application execution unit 120 allows the HTTP server 1 10 to read, at the time of transmitting an HTTP response, data from the storage device 140 , and then to write the data to an HTML file.
- memory copying from the socket buffer of the kernel memory to the user memory is performed upon receipt of data. Meanwhile, upon transmission of data, memory copying from the user memory to the socket buffer of the kernel memory may be performed. Moreover, transmission and reception of data between the HTTP server and the application execution unit 120 may be carried out through a kernel memory managed by the OS. Accordingly, every time data is forwarded from one to the other, memory copying is performed twice between the user memory and the kernel memory.
- this embodiment adopts a character string object for specially handling file processing, as one of objects constituting an HTML file.
- This character string object is referred to as a “file-type character string object”.
- the file-type character string object of this embodiment only holds the file name (URI) of the file.
- This implementation may be transparent to the application program, and holds the same semantics as an ordinary character string object.
- a file-type character string object may actually read the file and holds its contents as similar to an ordinary character string object.
- the file-type character string object may acquire the information without actually reading the file.
- This acquisition of contents of a file by the file-type character string object is carried out by the HTTP server 110 .
- the application execution unit 120 may add special information to the header of a message in FastCGI protocol, which is transmitted from the application execution unit 120 to the HTTP server 110 .
- This header information is referred to as “X-FileString header”.
- a position of a file name included in the body portion of a FastCGI message (an offset value indicating the position of the first character of the file name, and the length of the file name) is written in an X-FileString header.
- the HTTP server 110 identifies a file according to this X-FileString header, and transmits the file to the client 200 by use of a sendfile system call of the OS, for example.
- This PHP script is described in a pattern often used in a web application, and may be used to display characters “hello”, contents of an HTML file A (document), and characters “bye”.
- the application execution unit 120 firstly parses the PHP script and may translate it into an instruction code. Then, the application execution unit 120 can execute the translated instruction code. At this time, when executing an instruction code corresponding to ECHO (display character string in the standard output), the application execution unit 120 may determine whether or not the target variable is a file-type character string object.
- ECHO display character string in the standard output
- the application execution unit 120 may add a URI (/tmp/fileA.html) for the file name, instead of contents of the file, to the FastCGI packet.
- the application execution unit 120 also describes X-FileString as the header information, and specifies an offset value indicating the position of the file name in the FastCGI packet, and the length of the file name.
- the FastCGI packet generated by the application execution unit 120 is transmitted to the HTTP server 110 to be processed.
- the HTTP server 110 parses the header of the received FastCGI packet. On finding an X-FileString header, the HTTP server 110 returns a file designated by the X-FileString header to the client 200 by use of a sendfile system call, instead of just forwarding the FastCGI packet to the socket.
- a file that does not require processing by the application execution unit 120 may be acquired by the HTTP server 110 instead of the application execution unit 120 , and then may be transmitted to the client 200 .
- memory copying by the application execution unit 120 for acquiring the file can be omitted, and the file is not copied either, even in the memory copying carried out when the application execution unit 120 transmits the FastCGI packet to the HTTP server 110 .
- the HTTP server 110 returns a response to the client 200 , the file is transmitted directly from the kernel memory to the client 200 without the intervention of the user memory. Accordingly, the amount of omission of memory copying for the file contributes to reduction in the processing cost accordingly, and thus improves the operational performance of the web application server 100 .
- this embodiment can assure the contents of the files by a scheme using a hard link including a Copy-on-write function on the OS level or the PHP processor level. This function is provided by the extension library 122 in the embodiment. Details of the method of assuring the contents of the files by use of the hard link will be described later.
- the application execution unit 120 may acquire an HTTP request from the client 200 through the HTTP server 110 , and may dynamically generate an HTML file which becomes an HTTP response in response to the HTTP request. At this time, the application execution unit 120 executes a PHP script written in the HTML file which becomes the HTTP response, by use of the runtime 121 and the extension library 122 .
- FIG. 4 is a flowchart illustrating operations of the application execution unit 120 carried out by the extension library 122 .
- the application execution unit 120 sequentially acquires instruction codes of a PHP script, and performs processing by use of the extension library 122 . As shown in FIG. 4 , the application execution unit 120 firstly determines whether or not a character string being a target of processing by the instruction code is a file-type character string object (step 401 ). Whether or not a processing target is a file-type character string object can be determined based on a function or the like of the instruction code. For instance, a processing target is determined to be a file-type character string object if the function thereof is “file_get_contents” or the like. Specifically, a definition may be made in advance on which instruction codes and functions should be the bases of determination of the processing target as being a file-type character string object.
- the application execution unit 120 On determining that the processing target is a file-type character string object, the application execution unit 120 then may determine whether or not the OS of the web application server 100 has a hard link corresponding to Copy-on-write (step 402 ). If the OS includes this function (such as ext3cow and WFS), the application execution unit 120 can generate a hard link to the transmission target file by use of this function of the OS (by making a request to the OS execution unit 130 ) (step 403 ). The hard link may be generated based on the file name of the original file (that is, the file read by the function of the instruction code).
- the character string object (file-type character string object) has the following attributes.
- TYPE indicates the type of character string object
- FILE indicates that the type of character string object is a file type
- VALUE indicates the file name of the file to be transmitted by the HTTP server 110 .
- ORIGINAL indicates the file name of the hard-linked original file.
- Cow-handler indicates which level the Copy-on-write function is implemented, and in this case, indicates that the OS provides the function.
- the application execution unit 120 can perform the following processing so as to provide a similar function by itself (step 404 ).
- the character string object generated in step 404 is mainly the same as that generated in step 403 , apart from “Cow-handler” that can indicate the implementation level of the Copy-on-write function, which in this case is PHP.
- operations (4) and (5) are carried out only in the following case. Specifically, the operations are carried out only if writing is performed on the file in a period of time from when the runtime 121 performs processing after the character string object is generated in (3), until the HTTP server 110 acquires the file.
- the application execution unit 120 moves on to the processing by use of the runtime 121 (step 405 ). Meanwhile, on determining in step 401 that the processing target is not a file-type character string object, the application execution unit 120 performs, if necessary, the same processing as normal processing of the PHP processor by use of the extension library 122 (step 406 ), and then moves on to the processing by use of the runtime 121 (step 405 ).
- FIG. 5 is a flowchart illustrating operations of the application execution unit 120 carried out by the runtime 121 .
- the application execution unit 120 sequentially can acquire the instruction codes having undergone the processing by the extension library 122 . Then, the application execution unit 120 may determine whether or not each of the instruction codes is “ECHO” (step 501 ).
- the application execution unit 120 then can determine whether or not the object being a target of processing is a file-type character string object (step 502 ). On determining that the object is a file-type character string object, the application execution unit 120 may add a file name included in the value of the object into a body portion of a packet of FastCGI used as an SAPI. The application execution unit 120 also can add an offset value indicating the position of the file name and the length of the file name, into the X-FileString header of the FastCGI packet (step 503 ).
- information related to the hard link (link name and length of link name) generated by the extension library 122 may also be added into each of the body portion of the FastCGI packet and the X-FileString header.
- a format of the X-FileString header is as follows, for example.
- the link name of the hard link is “/tmp/fileA.html-link.”
- the header portion (X-FileString header) and the body portion of the FastCGI packet can be expressed as in FIG. 6 .
- the application execution unit 120 then can add contents of the character string (value of String) to the body portion of the FastCGI packet (step 504 ).
- the application execution unit 120 may determine whether or not the object is a file-type character string object and the function to be executed has an influence on the character string (step 505 ).
- a function having an influence on a character string is the trim function, for example, which eliminates blanks from a character string. Specific functions that influence a character string may be defined in advance.
- the application execution unit 120 then can read the processing target file and can replace the file-type character string object by an ordinary character string object (step 506 ). Thereafter, the application execution unit 120 may execute the instruction code acquired in step 501 , and generates a FastCGI packet (step 507 ).
- the file fileA.html
- processing for an ordinary character string object is performed.
- the application execution unit 120 directly executes the instruction code acquired in step 501 , and can generate a FastCGI packet (step 507 ).
- the instruction code is executed without reading the processing target file if the function does not influence the character string.
- the application execution unit 120 can check whether there is left an instruction code yet to be processed (step 508 ). Then, the processes of steps 501 to 507 may be sequentially performed on each instruction code of the PHP script. When the processing is completed for all of the instruction codes, the application execution unit 120 can pass the generated FastCGI packet to the HTTP server 110 through the communication channel (SAPI) (step 509 ).
- SAPI communication channel
- a basic operation of the HTTP server 110 is to return an HTML file generated by the application execution unit 120 to the client 200 , as a response to a received HTTP request.
- the instruction code of the PHP script in the original HTML file is “ECHO”
- contents of the file designated by the object may need to be transmitted to the client 200 together with the HTML file.
- the HTTP server 110 reads the transmission target file from the storage device 140 and transmits the contents of the file to the client 200 , together with the HTML file.
- FIG. 7 is a flowchart illustrating operations of data processing by the HTTP server 110 , at the time of transmitting an HTML file.
- the HTTP server 110 may determine whether or not an X-FileString header is included in the header portion of the FastCGI packet (step 702 ). If an X-FileString header is included therein, the HTTP server 110 performs a series of processes below (steps 703 to 706 ).
- the HTTP server 110 firstly may acquire an offset value of a file name, the length of an original file name, and the length of a link name which are described in the X-FileString header of the FastCGI packet (step 703 ). Then, the HTTP server 110 focuses on the body portion of the FastCGI packet, starting from the first data to the next sequentially, and transmits specific message data described in the body portion to the socket buffer (step 704 ).
- the message data to be transmitted ranges from the current position (top position at initial time) to the position indicated by the offset value acquired in step 703 .
- the HTTP server 110 may acquire the file name and the link name described in the body portion of the FastCGI packet.
- the HTTP server 110 then transmits a file specified by this file name or link name to the socket buffer by use of a sendfile system call (step 705 ).
- the HTTP server 110 may check whether the target file has been updated by using this file name, link name and a stat system call. If the file has not been updated, the HTTP server 110 can transmit the file specified by the link name (a copy file generated by the application execution unit 120 by use of the extension library 122 ) to the socket buffer.
- the HTTP server 110 may transmit the file specified by the original file name to the socket buffer. Since the file is transmitted by use of a sendfile system call in this processing, the target file may be directly transmitted to the socket buffer after being read from the storage device 140 and stored in a file buffer of the kernel memory. That is, files are not copied from a user memory used by the application of the HTTP server 110 to the kernel memory including the socket buffer.
- the HTTP server 110 can determine whether or not the current focus position in the body portion of the FastCGI packet has reached the end of the body portion (step 706 ). If not, the processing goes back to step 703 and the processes of steps 703 to 705 are repeated. Incidentally, the processes of steps 704 and 705 are skipped as needed if there is no corresponding data (character string which is not a file name, original file name, or link name).
- the HTTP server 110 can transmit the message data written in the body portion of the FastCGI packet to the socket buffer, without performing any special data processing (step 707 ).
- the HTTP server 110 can transmit the data transmitted to the socket buffer in the above manner, to the client 200 as an HTTP response.
- the message “hello” indicating characters corresponding to offset from 0 to 4 in the body portion of the FastCGI packet is firstly transmitted to the socket buffer (see step 704 in FIG. 7 ). Then, a file is transmitted to the socket buffer (see step 705 in FIG. 7 ) according to the file name “/tmp/fileA.html” or the link name “/tmp/fileA.html-link”. Thereafter, since the focus position does not reach the end of the body portion, the processing of step 703 and the following steps are repeated, so that the message “bye” indicating characters corresponding to offset from 40 to 42 is transmitted to the socket buffer (step 704 in FIG. 7 ).
- FIG. 8 is a diagram illustrating a state of memory copying in the operations of the web application server of this embodiment.
- FIG. 9 is a diagram illustrating a state of memory copying in the operations of a conventional web application server. Note that FIGS. 8 and 9 illustrate operations in cases where the instruction code of the PHP script is “ECHO”.
- memory copying may be performed once (C 1 ) when the HTTP server 110 receives an HTTP request, twice (C 2 and C 3 ) when data is transferred from the HTTP server 110 to the application execution unit 120 , twice (C 5 and C 6 ) when data is transferred from the application execution unit 120 to the HTTP server 110 , and several times (C 7 ) when the HTTP server 110 transmits an HTTP response.
- the memory copying at the time of transmitting an HTTP response by the HTTP server 110 may be repeated according to the number of repetitions of the alternate calling of an echo and a file_get_contents function.
- another memory copying may be performed (C 4 ) when the file is read from the storage device 140 during the processing by the application execution unit 120 .
- the memory copying (C 7 ) at the time of transmitting an HTTP response by the HTTP server 110 may be performed only once.
- Durations of time required for each of the memory copying operations (C 1 to C 7 ) in FIG. 9 are represented by T 1 , T 2 , T 3 , T 4 , T 5 , T 6 and T 7 , respectively, in the order of their occurrences. Meanwhile, durations of time required for each of the memory copying operations (C 1 to C 3 , and C 5 to C 7 ) in FIG. 8 may be similarly represented by T 1 , T 2 , T 3 , T 5 ′, T 6 ′ and ⁇ t ⁇ i ⁇ , respectively, in the order of their occurrences. Note that i in ⁇ t ⁇ i ⁇ denotes the number of times of memory copying performed when the HTTP server 110 transmits an HTTP response.
- FIGS. 8 and 9 A comparison between FIGS. 8 and 9 indicates that the same duration of time may be required for the three memory copying operations (C 1 to C 3 ) performed until the HTTP request is transferred to the application execution unit 120 (T 1 , T 2 and T 3 ).
- the application execution unit 120 does not read the file, and thus memory copy C 4 does not exist.
- the data transferred from the application execution unit 120 to the HTTP server 110 does not include the file, the transferred data volume is less than in the case in FIG. 9 .
- T 5 >T 5 ′ and T 6 >T 6 ′ are true. Meanwhile in FIG.
- the memory copying at the time of transmitting the HTTP response by the HTTP server 110 requires time for executing a sendfile system call, in addition to ⁇ t ⁇ i ⁇ . Accordingly, as shown in FIG. 10 , a comparison can be made between the total duration of time required for the memory copying of this embodiment illustrated in FIG. 8 , and the conventional memory copying illustrated in FIG. 9 .
- the operations of this embodiment require cost of time for the multiple times of memory copying performed in ⁇ t ⁇ i ⁇ and for the sendfile system calls executed at that time, in addition to the cost of time for the conventional operations.
- cost of time for the multiple times of memory copying performed in ⁇ t ⁇ i ⁇ and for the sendfile system calls executed at that time, in addition to the cost of time for the conventional operations.
- the operations of this embodiment are capable of larger reduction in cost of time than the conventional operations are.
- file copying is not performed between the user memory and the kernel memory in this embodiment, only a small memory capacity may be required for memory copying, which also contributes to cost reduction.
- the present invention employing the above configuration may be capable of improving the operational performance of the web application server by reducing the processing cost of memory copying.
- the processing cost reduction can be achieved by eliminating a read operation of a file unnecessary for dynamic generation of an HTML file.
- the application execution unit 120 is described as a PHP language processor in the embodiment, any other processor capable of describing a script in an HTML file may be employed.
- the communication channel (SAPI) between the HTTP server 110 and the application execution unit 120 is described as FastCGI, any other SAPI such as mod php may be used.
- the operations of this embodiment may be used in combination with the operations shown in FIG. 9 in the web application server 100 . Specifically, the operation of the embodiment may be dynamically applied when the difference explained in FIG. 10 becomes larger than 0, by carrying out a test while the web application server 100 is in use.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
-
- TYPE:FILE
- VALUE:/tmp/fileA-link.html
- ORIGINAL:/tmp/fileA.html
- Cow-handler:OS
-
- TYPE:FILE
- VALUE:/tmp/fileA-link.html
- ORIGINAL:/tmp/fileA.html
- Cow-handler:PHP
Claims (12)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008-142847 | 2008-05-30 | ||
| JP2008142847A JP5235504B2 (en) | 2008-05-30 | 2008-05-30 | A server that dynamically generates web content |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| US20090300102A1 US20090300102A1 (en) | 2009-12-03 |
| US8090769B2 true US8090769B2 (en) | 2012-01-03 |
Family
ID=41381124
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US12/336,230 Active 2029-08-08 US8090769B2 (en) | 2008-05-30 | 2008-12-16 | Dynamically generating web contents |
Country Status (2)
| Country | Link |
|---|---|
| US (1) | US8090769B2 (en) |
| JP (1) | JP5235504B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150161081A1 (en) * | 2011-07-26 | 2015-06-11 | Google Inc. | Techniques for server-side determination of font subsets |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102695049B (en) * | 2012-05-09 | 2015-06-10 | 浙江宇视科技有限公司 | Transmission method and apparatus of code stream |
| US20140280484A1 (en) * | 2013-03-15 | 2014-09-18 | Oliver Klemenz | Dynamic Service Extension Infrastructure For Cloud Platforms |
| JP6764115B2 (en) | 2017-01-31 | 2020-09-30 | 富士通株式会社 | Display program, display method and display device |
| CN112988499B (en) * | 2019-12-16 | 2022-10-21 | 阿波罗智联(北京)科技有限公司 | Data processing method, apparatus, electronic device and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030028695A1 (en) * | 2001-05-07 | 2003-02-06 | International Business Machines Corporation | Producer/consumer locking system for efficient replication of file data |
| US20060015632A1 (en) * | 2001-04-04 | 2006-01-19 | Prodigy Communications, Lp | Method, system, and software for transmission of information |
| US20080114882A1 (en) * | 2006-11-13 | 2008-05-15 | David Alan Christenson | Multiplexing Multiple Client Connections in a Single Socket |
-
2008
- 2008-05-30 JP JP2008142847A patent/JP5235504B2/en active Active
- 2008-12-16 US US12/336,230 patent/US8090769B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060015632A1 (en) * | 2001-04-04 | 2006-01-19 | Prodigy Communications, Lp | Method, system, and software for transmission of information |
| US20030028695A1 (en) * | 2001-05-07 | 2003-02-06 | International Business Machines Corporation | Producer/consumer locking system for efficient replication of file data |
| US20080114882A1 (en) * | 2006-11-13 | 2008-05-15 | David Alan Christenson | Multiplexing Multiple Client Connections in a Single Socket |
Non-Patent Citations (1)
| Title |
|---|
| "Lighty's Life Faster Fast CGI", [online], Nov. 29, 2006, lighty's life, http://blog.lighttpd.net/articles/2006/11/29/faster-fastcgi. |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150161081A1 (en) * | 2011-07-26 | 2015-06-11 | Google Inc. | Techniques for server-side determination of font subsets |
| US9164968B2 (en) * | 2011-07-26 | 2015-10-20 | Google Inc. | Techniques for server-side determination of font subsets |
| US9275018B2 (en) | 2011-07-26 | 2016-03-01 | Google Inc. | Techniques for analyzing web pages to determine font subsets |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2009289153A (en) | 2009-12-10 |
| US20090300102A1 (en) | 2009-12-03 |
| JP5235504B2 (en) | 2013-07-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3103018B1 (en) | Method for debugging computer program | |
| US9235451B2 (en) | Browser kernel switching method | |
| JP5042693B2 (en) | Optimize storage and transmission of markup language files | |
| US9015695B2 (en) | Information processing apparatus and information processing method | |
| US20100218106A1 (en) | Automatically Selecting Internet Browser and Providing Web Page Service | |
| US20170272499A1 (en) | Method and device for loading webpage | |
| JP2016504694A (en) | Resource calls for hybrid applications | |
| KR20140116874A (en) | Managing script file dependencies and load times | |
| US8090769B2 (en) | Dynamically generating web contents | |
| JP5039946B2 (en) | Technology for relaying communication between client devices and server devices | |
| CN110825425A (en) | Configuration data management method and device, electronic equipment and storage medium | |
| US8352858B2 (en) | High-speed web server | |
| CN114489622B (en) | Static resource management method, Node.js application, electronic device and storage medium | |
| CN108255434B (en) | Label management method, management device and computer readable storage medium | |
| US20100011283A1 (en) | Minimizing the copying of an extensible markup language (xml) tree when referencing tree nodes during extensible stylesheet language transformations (xslt) processing | |
| CN112395194B (en) | Method and device for accessing test platform | |
| US7721278B2 (en) | Modular server architecture for multi-environment HTTP request processing | |
| US20140331117A1 (en) | Application-based dependency graph | |
| CN112783548B (en) | Access method and device of network system | |
| US20110321043A1 (en) | System, Method and Program Product for Native Interface Optimization of Read-Only Arrays | |
| US8191041B2 (en) | Javascript pre-processing framework | |
| US8793663B2 (en) | Smart cache for a server test environment in an application development tool | |
| CN114647411B (en) | Programming interface loading method, device, electronic device and storage medium | |
| CN111026463A (en) | A page loading method, apparatus, device and storage medium | |
| CN107357853B (en) | Method and device for operating REDIS console and computer system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| AS | Assignment |
Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:SUZUMURA, TOYOTARO;TATSUBORI, MICHIAKI;TRENT, SCOTT;AND OTHERS;REEL/FRAME:021989/0216 Effective date: 20081216 |
|
| STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
| REMI | Maintenance fee reminder mailed | ||
| FPAY | Fee payment |
Year of fee payment: 4 |
|
| SULP | Surcharge for late payment | ||
| AS | Assignment |
Owner name: MIDWAY TECHNOLOGY COMPANY LLC, MICHIGAN Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:INTERNATIONAL BUSINESS MACHINES CORPORATION;REEL/FRAME:037704/0257 Effective date: 20151231 |
|
| AS | Assignment |
Owner name: SERVICENOW, INC., CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:MIDWAY TECHNOLOGY COMPANY LLC;REEL/FRAME:038324/0816 Effective date: 20160324 |
|
| FEPP | Fee payment procedure |
Free format text: PAYER NUMBER DE-ASSIGNED (ORIGINAL EVENT CODE: RMPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Free format text: PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
| MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 8TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1552); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 8 |
|
| MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 12TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1553); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 12 |