Method for Starting Serverless Container and Related Device

Information

  • Patent Application
  • 20230297352
  • Publication Number
    20230297352
  • Date Filed
    May 25, 2023
    12 months ago
  • Date Published
    September 21, 2023
    8 months ago
Abstract
A method for starting a serverless container includes loading a code segment file of an application to create an application instance; and loading a snapshot file of the application, where the snapshot file includes a deserialized data segment of the application.
Description
Claims
  • 1. A method for starting a serverless container, wherein the method comprises: loading a code segment file of an application to create an application instance; andloading a snapshot file of the application,wherein the snapshot file comprises a deserialized data segment of the application.
  • 2. The method of claim 1, wherein loading the snapshot file comprises mapping the deserialized data segment to a data area of the application instance.
  • 3. The method of claim 2, wherein mapping the deserialized data segment comprises mapping the deserialized data segment using a copy-on-write technology.
  • 4. The method of claim 1, wherein before loading the code segment file, the method further comprises: receiving a source code file of the application; andcompiling the source code file to obtain the code segment file and the snapshot file.
  • 5. The method of claim 4, wherein compiling the source code file and the snapshot file comprises: compiling the source code file using a compiler to generate the code segment file and an initialization data file;preloading the code segment file and the initialization data file;deserializing the initialization data file; andperforming a snapshot operation on memory of the application to obtain the snapshot file.
  • 6. The method of claim 5, further comprising uploading the code segment file and the snapshot file of the application to an image repository.
  • 7. A starting device, comprising: an interface; andone or more processors coupled to the interface and configured to: load a code segment file of an application;create an application instance based on the code segment file; andload a snapshot file of the application,wherein the snapshot file comprises a deserialized data segment of the application.
  • 8. The starting device of claim 7, wherein the one or more processors are further configured to map the deserialized data segment to a data area of the application instance.
  • 9. The starting device of claim 8, wherein the one or more processors are further configured to map the deserialized data segment using a copy-on-write technology.
  • 10. The starting device of claim 7, wherein the one or more processors are further configured to: receive a source code file of the application; andcompile the source code file to obtain the code segment file and the snapshot file.
  • 11. The starting device of claim 10, wherein the one or more processors are further configured to: compile the source code file to generate the code segment file and an initialization data file;preload the code segment file and the initialization data file;deserialize the initialization data file; andperform a snapshot operation on memory of the application to obtain the snapshot file.
  • 12. The starting device of claim 11, wherein the one or more processors are further configured to upload the code segment file and the snapshot file of the application to an image repository.
  • 13. The starting device of claim 7, wherein the snapshot file comprises a deserialized heap memory page of the application.
  • 14. A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable storage medium and that, when executed by one or more processors, cause a starting device to: load a code segment file of an application to create an application instance; andload a snapshot file of the application,wherein the snapshot file comprises a deserialized data segment of the application.
  • 15. The computer program product of claim 14, wherein the instructions, when executed by the one or more processors, further cause the starting device to map the deserialized data segment to a data area of the application instance.
  • 16. The computer program product of claim 15, wherein the instructions, when executed by the one or more processors, further cause the starting device to map the deserialized data segment using a copy-on-write technology.
  • 17. The computer program product of claim 14, wherein the instructions, when executed by the one or more processors, further cause the starting device to: receive a source code file of the application; andcompile the source code file to obtain the code segment file and the snapshot file.
  • 18. The computer program product of claim 17, wherein the instructions, when executed by the one or more processors, further cause the starting device to: compile the source code file using a compiler to generate the code segment file and an initialization data file;preload the code segment file and the initialization data file;deserialize the initialization data file; andperform a snapshot operation on memory of the application to obtain the snapshot file.
  • 19. The computer program product of claim 18, wherein the instructions, when executed by the one or more processors, further cause the starting device to upload the code segment file and the snapshot file of the application to an image repository.
  • 20. The computer program product of claim 14, wherein the snapshot file comprises a deserialized heap memory page of the application.
Priority Claims (2)
Number Date Country Kind
202011351195.6 Nov 2020 CN national
202110251883.3 Mar 2021 CN national
Continuations (1)
Number Date Country
Parent PCT/CN2021/100872 Jun 2021 WO
Child 18323842 US