From b93eb8c097ae8b335632206614e989cf59ff1289 Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sat, 19 Aug 2023 22:23:58 +0000 Subject: [PATCH 01/13] feat(benchmark): updated HTTP.jl benchmark --- frameworks/Julia/Marily/API.jl | 136 +++++ frameworks/Julia/Marily/Manifest.toml | 506 ++++++++++++++++++ frameworks/Julia/Marily/Pool.jl | 22 + frameworks/Julia/Marily/Project.toml | 8 + frameworks/Julia/Marily/README.md | 24 + frameworks/Julia/Marily/benchmark_config.json | 28 + frameworks/Julia/Marily/julia_server.jl | 41 ++ frameworks/Julia/Marily/marily.dockerfile | 21 + 8 files changed, 786 insertions(+) create mode 100644 frameworks/Julia/Marily/API.jl create mode 100644 frameworks/Julia/Marily/Manifest.toml create mode 100644 frameworks/Julia/Marily/Pool.jl create mode 100644 frameworks/Julia/Marily/Project.toml create mode 100644 frameworks/Julia/Marily/README.md create mode 100644 frameworks/Julia/Marily/benchmark_config.json create mode 100644 frameworks/Julia/Marily/julia_server.jl create mode 100644 frameworks/Julia/Marily/marily.dockerfile diff --git a/frameworks/Julia/Marily/API.jl b/frameworks/Julia/Marily/API.jl new file mode 100644 index 00000000000..f78029a2792 --- /dev/null +++ b/frameworks/Julia/Marily/API.jl @@ -0,0 +1,136 @@ + +struct jsonMsgObj + message::String +end + +struct jsonObj + id::Int64 + randomNumber::Int64 +end + +StructTypes.StructType(::Type{jsonMsgObj}) = StructTypes.Struct() +StructTypes.StructType(::Type{jsonObj}) = StructTypes.Struct() + +function getqueries(req) + params = HTTP.queryparams(HTTP.URI(req.target).query) + return try + min(500, max(1, parse(Int64, get(params, "queries", "1")))) + catch ArgumentError + 1 + end +end + +function plaintext(req::HTTP.Request) + headers = [ + "Content-Type" => "text/plain", + "Server" => "Julia-HTTP", + "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT", + ] + + return HTTP.Response(200, headers, body = "Hello, World!") +end + +function jsonSerialization(req::HTTP.Request) + headers = [ + "Content-Type" => "application/json", + "Server" => "Julia-HTTP", + "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT", + ] + + return HTTP.Response(200, headers, body = JSON3.write(jsonMsgObj("Hello, World!"))) +end + +function singleQuery(req::HTTP.Request) + headers = [ + "Content-Type" => "application/json", + "Server" => "Julia-HTTP", + "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT", + ] + + randNum = rand(1:10000) + + dbNumber = withdb() do conn + sqlQuery = "SELECT randomnumber, id FROM world WHERE id = \$1" + results = LibPQ.execute(conn, sqlQuery, [randNum]) + first(first(results)) + end + + return HTTP.Response(200, headers, body = JSON3.write(jsonObj(randNum, dbNumber))) +end + +function multipleQueries(req::HTTP.Request) + headers = [ + "Content-Type" => "application/json", + "Server" => "Julia-HTTP", + "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT", + ] + + nqueries = getqueries(req) + responseArray = sizehint!(Vector{jsonObj}(), nqueries) + for i = 1:nqueries + withdb() do conn + randNum = rand(1:10000) + results = LibPQ.execute(conn, "SELECT * FROM World WHERE id = \$1 ", [randNum]) + push!(responseArray, jsonObj(randNum, first(results)[2])) + end + end + return HTTP.Response(200, headers, body = JSON3.write(responseArray)) +end + +function updates(req::HTTP.Request) + headers = [ + "Content-Type" => "application/json", + "Server" => "Julia-HTTP", + "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT", + ] + + nqueries = getqueries(req) + responseArray = sizehint!(Vector{jsonObj}(), nqueries) + withdb() do conn + for i = 1:nqueries + randId = rand(1:10000) + randNum = rand(1:10000) + sqlQuery = "SELECT * FROM World WHERE id = $randId" + results = LibPQ.execute(conn, sqlQuery) + row = first(results) + dbNumber = row[2] + sqlQuery = "UPDATE World SET randomnumber = $randNum WHERE id = $randId" + results = LibPQ.execute(conn, sqlQuery) + push!(responseArray, jsonObj(randId, randNum)) + end + end + + return HTTP.Response(200, headers, body = JSON3.write(responseArray)) +end + +function fortunes(req::HTTP.Request) + headers = [ + "Content-Type" => "text/html; charset=utf-8", + "Server" => "Julia-HTTP", + "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT", + ] + + sqlQuery = "SELECT * FROM fortune" + output = "" + results = withdb() do conn + LibPQ.execute(conn, sqlQuery) + end + fortunesList = [[string(row[1]), row[2]] for row in results] + push!(fortunesList, [string(0), "Additional fortune added at request time."]) + sort!(fortunesList, by = x -> x[2]) + + body = "" * string(@htl(""" + + + Fortunes + + + + + $([@htl("\n") for f in fortunesList]) +
idmessage
$(f[1])$(f[2])
+ + + """)) + return HTTP.Response(200, headers, body) +end diff --git a/frameworks/Julia/Marily/Manifest.toml b/frameworks/Julia/Marily/Manifest.toml new file mode 100644 index 00000000000..5ffdadc24c4 --- /dev/null +++ b/frameworks/Julia/Marily/Manifest.toml @@ -0,0 +1,506 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.9.2" +manifest_format = "2.0" +project_hash = "350c12e51175a69408a5d41399f431a2b8090984" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "3.6.2" + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + + [deps.Adapt.weakdeps] + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BitFlags]] +git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.7" + +[[deps.CEnum]] +git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90" +uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" +version = "0.4.2" + +[[deps.CSTParser]] +deps = ["Tokenize"] +git-tree-sha1 = "3ddd48d200eb8ddf9cb3e0189fc059fd49b97c1f" +uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f" +version = "3.3.6" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "02aa26a4cf76381be7f66e020a3eddeb27b0a092" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.2" + +[[deps.CommonMark]] +deps = ["Crayons", "JSON", "PrecompileTools", "URIs"] +git-tree-sha1 = "532c4185d3c9037c0237546d817858b23cf9e071" +uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6" +version = "0.8.12" + +[[deps.Compat]] +deps = ["UUIDs"] +git-tree-sha1 = "e460f044ca8b99be31d35fe54fc33a5c33dd8ed7" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.9.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.0.5+0" + +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "5372dbbf8f0bdb8c700db5367132925c0771ef7e" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.2.1" + +[[deps.Crayons]] +git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.1.1" + +[[deps.DBInterface]] +git-tree-sha1 = "9b0dc525a052b9269ccc5f7f04d5b3639c65bca5" +uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965" +version = "2.5.0" + +[[deps.DataAPI]] +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.15.0" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.15" + +[[deps.DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.Decimals]] +git-tree-sha1 = "e98abef36d02a0ec385d68cd7dadbce9b28cbd88" +uuid = "abce61dc-4473-55a0-ba07-351d65e31d42" +version = "0.4.1" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + +[[deps.ExprTools]] +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.10" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.Glob]] +git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" +uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" +version = "1.3.1" + +[[deps.HTTP]] +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "cb56ccdd481c0dd7f975ad2b3b62d9eda088f7e2" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "1.9.14" + +[[deps.HypertextLiteral]] +deps = ["Tricks"] +git-tree-sha1 = "c47c5fa4c5308f27ccaac35504858d8914e102f9" +uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" +version = "0.9.4" + +[[deps.Infinity]] +deps = ["Dates", "Random", "Requires"] +git-tree-sha1 = "cf8234411cbeb98676c173f930951ea29dca3b23" +uuid = "a303e19e-6eb4-11e9-3b09-cd9505f79100" +version = "0.2.4" + +[[deps.InlineStrings]] +deps = ["Parsers"] +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" +version = "1.4.0" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.Intervals]] +deps = ["Dates", "Printf", "RecipesBase", "Serialization", "TimeZones"] +git-tree-sha1 = "ac0aaa807ed5eaf13f67afe188ebc07e828ff640" +uuid = "d8418881-c3e1-53bb-8760-2df7ec849ed5" +version = "1.10.0" + +[[deps.IterTools]] +git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.8.0" + +[[deps.IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JSON3]] +deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] +git-tree-sha1 = "95220473901735a0f4df9d1ca5b171b568b2daa3" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.13.2" + +[[deps.JuliaFormatter]] +deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "PrecompileTools", "Tokenize"] +git-tree-sha1 = "680fb31c8b8e2cf482f48e55d8fa01ccc4469e04" +uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" +version = "1.0.35" + +[[deps.Kerberos_krb5_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "60274b4ab38e8d1248216fe6b6ace75ae09b0502" +uuid = "b39eb1a6-c29a-53d7-8c32-632cd16f18da" +version = "1.19.3+0" + +[[deps.LayerDicts]] +git-tree-sha1 = "6087ad3521d6278ebe5c27ae55e7bbb15ca312cb" +uuid = "6f188dcb-512c-564b-bc01-e0f76e72f166" +version = "1.0.0" + +[[deps.LazyArtifacts]] +deps = ["Artifacts", "Pkg"] +uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.3" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "7.84.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibPQ]] +deps = ["CEnum", "DBInterface", "Dates", "Decimals", "DocStringExtensions", "FileWatching", "Infinity", "Intervals", "IterTools", "LayerDicts", "LibPQ_jll", "Libdl", "Memento", "OffsetArrays", "SQLStrings", "Tables", "TimeZones", "UTCDateTimes"] +git-tree-sha1 = "ddf729fd85ff07d55b94338ca2f1a4ce2b6dd96e" +uuid = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +version = "1.17.0" + +[[deps.LibPQ_jll]] +deps = ["Artifacts", "JLLWrappers", "Kerberos_krb5_jll", "Libdl", "OpenSSL_jll", "Pkg"] +git-tree-sha1 = "a299629703a93d8efcefccfc16b18ad9a073d131" +uuid = "08be9ffa-1c94-5ee5-a977-46a84ec9b350" +version = "14.3.0+1" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.10.2+0" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoggingExtras]] +deps = ["Dates", "Logging"] +git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e" +uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" +version = "1.0.0" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"] +git-tree-sha1 = "03a9b9718f5682ecb107ac9f7308991db4ce395b" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.1.7" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.2+0" + +[[deps.Memento]] +deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"] +git-tree-sha1 = "bb2e8f4d9f400f6e90d57b34860f6abdc51398e5" +uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" +version = "1.4.1" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.Mocking]] +deps = ["Compat", "ExprTools"] +git-tree-sha1 = "4cc0c5a83933648b615c36c2b956d94fda70641e" +uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" +version = "0.7.7" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2022.10.11" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.OffsetArrays]] +deps = ["Adapt"] +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.12.10" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.21+4" + +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.4.1" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "bbb5c2115d63c2f1451cb70e5ef75e8fe4707019" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.22+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.2" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.7.2" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.9.2" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.1.2" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.0" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA", "Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RecipesBase]] +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.3.4" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.SQLStrings]] +git-tree-sha1 = "55de0530689832b1d3d43491ee6b67bd54d3323c" +uuid = "af517c2e-c243-48fa-aab8-efac3db270f5" +version = "0.1.0" + +[[deps.Scratch]] +deps = ["Dates"] +git-tree-sha1 = "30449ee12237627992a99d5e30ae63e4d78cd24a" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.2.0" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.10.0" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[deps.Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"] +git-tree-sha1 = "1544b926975372da01227b382066ab70e574a3ec" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.10.1" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.TimeZones]] +deps = ["Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "Unicode"] +git-tree-sha1 = "5b347464bdac31eccfdbe1504d9484c31645cafc" +uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" +version = "1.11.0" + +[[deps.Tokenize]] +git-tree-sha1 = "90538bf898832b6ebd900fa40f223e695970e3a5" +uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624" +version = "0.5.25" + +[[deps.TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.13" + +[[deps.Tricks]] +git-tree-sha1 = "aadb748be58b492045b4f56166b5188aa63ce549" +uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" +version = "0.1.7" + +[[deps.URIs]] +git-tree-sha1 = "b7a5e99f24892b6824a954199a45e9ffcc1c70f0" +uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" +version = "1.5.0" + +[[deps.UTCDateTimes]] +deps = ["Dates", "TimeZones"] +git-tree-sha1 = "4af3552bf0cf4a071bf3d14bd20023ea70f31b62" +uuid = "0f7cfa37-7abf-4834-b969-a8aa512401c2" +version = "1.6.1" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+0" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.48.0+0" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+0" diff --git a/frameworks/Julia/Marily/Pool.jl b/frameworks/Julia/Marily/Pool.jl new file mode 100644 index 00000000000..c5d3b233282 --- /dev/null +++ b/frameworks/Julia/Marily/Pool.jl @@ -0,0 +1,22 @@ +cnxpool = Pools.Pool{LibPQ.Connection}(25) + +function cnxisok(cnx::LibPQ.Connection) + return LibPQ.status(cnx) == LibPQ.libpq_c.CONNECTION_OK +end + +function newconnection() + return LibPQ.Connection( + "postgresql://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world" + # "postgresql://benchmarkdbuser:benchmarkdbpass@localhost:5555/hello_world" + ) +end + +function withdb(f) + connection = Base.acquire(newconnection, cnxpool; isvalid = cnxisok) + result = f(connection) + + !cnxisok(connection) && LibPQ.reset!(connection) + Base.release(cnxpool, connection) + + return result +end diff --git a/frameworks/Julia/Marily/Project.toml b/frameworks/Julia/Marily/Project.toml new file mode 100644 index 00000000000..ba9264822a1 --- /dev/null +++ b/frameworks/Julia/Marily/Project.toml @@ -0,0 +1,8 @@ +[deps] +ConcurrentUtilities = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" +HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" +JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" +LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" diff --git a/frameworks/Julia/Marily/README.md b/frameworks/Julia/Marily/README.md new file mode 100644 index 00000000000..1c34c059a39 --- /dev/null +++ b/frameworks/Julia/Marily/README.md @@ -0,0 +1,24 @@ +# Jewelia Benchmark Test + +[![Build Status](https://github.com/TechEmpower/FrameworkBenchmarks/workflows/build/badge.svg?branch=master&event=push)](https://github.com/TechEmpower/FrameworkBenchmarks/actions?query=workflow%3Abuild+branch%3Amaster) + +This is a submission for [TechEmpower Framework Benchmarks (TFB)](http://www.techempower.com/benchmarks/) using the [Julia](https://julialang.org/) language. + +All tests are located in [julia_server.jl](https://github.com/donavindebartolo/FrameworkBenchmarks/tree/master/frameworks/Julia/Jewelia). + +### Implemented benchmarks +- [x] JSON serialization +- [x] Single query +- [x] Multiple queries +- [x] Plaintext +- [x] Fortunes +- [x] Updates + +### + +This is an adaptation of the Jewelia benchmark, adapted for updated packages and Julia 1.9. + +Introduces: +- Multi-Threading +- Connection pool the connection +- formatted with JuliaFormatter \ No newline at end of file diff --git a/frameworks/Julia/Marily/benchmark_config.json b/frameworks/Julia/Marily/benchmark_config.json new file mode 100644 index 00000000000..cd13f9dad67 --- /dev/null +++ b/frameworks/Julia/Marily/benchmark_config.json @@ -0,0 +1,28 @@ +{ + "framework": "marily", + "tests": [{ + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "query_url": "/queries?queries=", + "update_url": "/updates?queries=", + "fortune_url": "/fortunes", + "port": 8080, + "approach": "Realistic", + "classification": "None", + "database": "Postgres", + "framework": "HTTP.jl", + "language": "Julia", + "flavor": "None", + "orm": "Raw", + "platform": "None", + "webserver": "HTTP.jl", + "os": "Linux", + "database_os": "Linux", + "display_name": "Marily", + "notes": "Http.jl", + "versus": "None" + } + }] +} diff --git a/frameworks/Julia/Marily/julia_server.jl b/frameworks/Julia/Marily/julia_server.jl new file mode 100644 index 00000000000..cdde7fc2001 --- /dev/null +++ b/frameworks/Julia/Marily/julia_server.jl @@ -0,0 +1,41 @@ +using Pkg +using Dates +using HTTP +using LibPQ +using JSON3 +using StructTypes +using ConcurrentUtilities: ConcurrentUtilities, Pools +using HypertextLiteral: @htl + +include("Pool.jl") +include("API.jl") + +function notfound(request) + @info "Not found" + return HTTP.Response(404, [], "") +end + +router = HTTP.Router() + +HTTP.register!(router, "GET", "/plaintext", plaintext) +HTTP.register!(router, "GET", "/json", jsonSerialization) +HTTP.register!(router, "GET", "/db", singleQuery) +HTTP.register!(router, "GET", "/queries", multipleQueries) +HTTP.register!(router, "GET", "/updates", updates) +HTTP.register!(router, "GET", "/fortunes", fortunes) +HTTP.register!(router, "/**", notfound) +HTTP.register!(router, "/", notfound) + +handler = HTTP.streamhandler(router) + +# running multiple processes doesn't seem to make any sense +# https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind + +# ConcurrentUtilities.init(20) +@info "Julia runs on $(Threads.nthreads()) threads" +HTTP.listen("0.0.0.0", 8080) do http + # t = ConcurrentUtilities.@spawn handler(http) + # wait(t) + handler(http) + return nothing +end diff --git a/frameworks/Julia/Marily/marily.dockerfile b/frameworks/Julia/Marily/marily.dockerfile new file mode 100644 index 00000000000..187da4d2f3e --- /dev/null +++ b/frameworks/Julia/Marily/marily.dockerfile @@ -0,0 +1,21 @@ +FROM julia:1.9.2 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update -yqq && apt-get install -y +RUN apt-get update -yqq && apt-get install -y wget + +COPY ./Project.toml ./Manifest.toml ./ + +# This step takes a lot of time, let's aggressively cache it +RUN julia --project=. -e 'import Pkg; Pkg.instantiate();' + +# Files +COPY ./ ./ + + +EXPOSE 8080 +# running multiple processes doesn't seem to make any sense +# https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind + +CMD julia --project=. --threads auto julia_server.jl From 7b793a37f93e0c3a0d6aa24acbdc202bedd5e8cc Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sat, 19 Aug 2023 22:29:55 +0000 Subject: [PATCH 02/13] fix: format --- frameworks/Julia/Marily/API.jl | 27 ++++++++++++++------------- frameworks/Julia/Marily/Pool.jl | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/frameworks/Julia/Marily/API.jl b/frameworks/Julia/Marily/API.jl index f78029a2792..4073544080f 100644 --- a/frameworks/Julia/Marily/API.jl +++ b/frameworks/Julia/Marily/API.jl @@ -119,18 +119,19 @@ function fortunes(req::HTTP.Request) push!(fortunesList, [string(0), "Additional fortune added at request time."]) sort!(fortunesList, by = x -> x[2]) - body = "" * string(@htl(""" - - - Fortunes - - - - - $([@htl("\n") for f in fortunesList]) -
idmessage
$(f[1])$(f[2])
- - - """)) + body = + "" * string(@htl(""" + + + Fortunes + + + + + $([@htl("\n") for f in fortunesList]) +
idmessage
$(f[1])$(f[2])
+ + + """)) return HTTP.Response(200, headers, body) end diff --git a/frameworks/Julia/Marily/Pool.jl b/frameworks/Julia/Marily/Pool.jl index c5d3b233282..63f42ca1a62 100644 --- a/frameworks/Julia/Marily/Pool.jl +++ b/frameworks/Julia/Marily/Pool.jl @@ -6,7 +6,7 @@ end function newconnection() return LibPQ.Connection( - "postgresql://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world" + "postgresql://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world", # "postgresql://benchmarkdbuser:benchmarkdbpass@localhost:5555/hello_world" ) end From ce20bb908a3f097465e90a7acf44759b74971c10 Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 20 Aug 2023 10:49:51 +0000 Subject: [PATCH 03/13] re-add run.sh, makes benchmark better but not sure why --- frameworks/Julia/Marily/API.jl | 14 ++++++------ frameworks/Julia/Marily/julia_server.jl | 28 ++++++++++++++++++----- frameworks/Julia/Marily/marily.dockerfile | 4 +++- frameworks/Julia/Marily/run.sh | 5 ++++ 4 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 frameworks/Julia/Marily/run.sh diff --git a/frameworks/Julia/Marily/API.jl b/frameworks/Julia/Marily/API.jl index 4073544080f..e98529f63f8 100644 --- a/frameworks/Julia/Marily/API.jl +++ b/frameworks/Julia/Marily/API.jl @@ -51,7 +51,7 @@ function singleQuery(req::HTTP.Request) dbNumber = withdb() do conn sqlQuery = "SELECT randomnumber, id FROM world WHERE id = \$1" - results = LibPQ.execute(conn, sqlQuery, [randNum]) + results = LibPQ.async_execute(conn, sqlQuery, [randNum]) |> fetch first(first(results)) end @@ -67,10 +67,10 @@ function multipleQueries(req::HTTP.Request) nqueries = getqueries(req) responseArray = sizehint!(Vector{jsonObj}(), nqueries) - for i = 1:nqueries - withdb() do conn + withdb() do conn + for i = 1:nqueries randNum = rand(1:10000) - results = LibPQ.execute(conn, "SELECT * FROM World WHERE id = \$1 ", [randNum]) + results = LibPQ.async_execute(conn, "SELECT * FROM World WHERE id = \$1 ", [randNum]) |> fetch push!(responseArray, jsonObj(randNum, first(results)[2])) end end @@ -91,11 +91,11 @@ function updates(req::HTTP.Request) randId = rand(1:10000) randNum = rand(1:10000) sqlQuery = "SELECT * FROM World WHERE id = $randId" - results = LibPQ.execute(conn, sqlQuery) + results = LibPQ.async_execute(conn, sqlQuery) |> fetch row = first(results) dbNumber = row[2] sqlQuery = "UPDATE World SET randomnumber = $randNum WHERE id = $randId" - results = LibPQ.execute(conn, sqlQuery) + results = LibPQ.async_execute(conn, sqlQuery) |> fetch push!(responseArray, jsonObj(randId, randNum)) end end @@ -113,7 +113,7 @@ function fortunes(req::HTTP.Request) sqlQuery = "SELECT * FROM fortune" output = "" results = withdb() do conn - LibPQ.execute(conn, sqlQuery) + LibPQ.async_execute(conn, sqlQuery) |> fetch end fortunesList = [[string(row[1]), row[2]] for row in results] push!(fortunesList, [string(0), "Additional fortune added at request time."]) diff --git a/frameworks/Julia/Marily/julia_server.jl b/frameworks/Julia/Marily/julia_server.jl index cdde7fc2001..52d29fd2d88 100644 --- a/frameworks/Julia/Marily/julia_server.jl +++ b/frameworks/Julia/Marily/julia_server.jl @@ -31,11 +31,27 @@ handler = HTTP.streamhandler(router) # running multiple processes doesn't seem to make any sense # https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind -# ConcurrentUtilities.init(20) +# ConcurrentUtilities.init(40) @info "Julia runs on $(Threads.nthreads()) threads" -HTTP.listen("0.0.0.0", 8080) do http - # t = ConcurrentUtilities.@spawn handler(http) - # wait(t) - handler(http) - return nothing + +function restart_server() + server = HTTP.listen!("0.0.0.0", 8080; reuseaddr=true) do http + # t = ConcurrentUtilities.@spawn handler(http) + # wait(t) + handler(http) + return nothing + end +end + +for _ in Iterators.repeated(true) + try + server = restart_server() + wait(server) + catch exc + try close(server) catch end + if exc isa InterruptException + rethrow() + end + @info "Server died, restarting" (exc, catch_backtrace()) + end end diff --git a/frameworks/Julia/Marily/marily.dockerfile b/frameworks/Julia/Marily/marily.dockerfile index 187da4d2f3e..012f3d69e42 100644 --- a/frameworks/Julia/Marily/marily.dockerfile +++ b/frameworks/Julia/Marily/marily.dockerfile @@ -13,9 +13,11 @@ RUN julia --project=. -e 'import Pkg; Pkg.instantiate();' # Files COPY ./ ./ +RUN chmod +x run.sh EXPOSE 8080 # running multiple processes doesn't seem to make any sense # https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind -CMD julia --project=. --threads auto julia_server.jl +# CMD julia --project=. --threads auto julia_server.jl +CMD ./run.sh \ No newline at end of file diff --git a/frameworks/Julia/Marily/run.sh b/frameworks/Julia/Marily/run.sh new file mode 100644 index 00000000000..3c5a5996045 --- /dev/null +++ b/frameworks/Julia/Marily/run.sh @@ -0,0 +1,5 @@ +for i in $(seq 0 $(($(nproc --all)-1))); + do julia --project=. --threads auto julia_server.jl & + done + +while : ; do sleep 1 ; done From 6d2c90479361b8a1e1f4da378d993f7b86abfc33 Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 20 Aug 2023 15:20:40 +0000 Subject: [PATCH 04/13] prettify & format --- frameworks/Julia/Marily/API.jl | 30 ++++++++++++++----------- frameworks/Julia/Marily/julia_server.jl | 7 ++++-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/frameworks/Julia/Marily/API.jl b/frameworks/Julia/Marily/API.jl index e98529f63f8..3a38626e519 100644 --- a/frameworks/Julia/Marily/API.jl +++ b/frameworks/Julia/Marily/API.jl @@ -1,21 +1,20 @@ - -struct jsonMsgObj +struct Message message::String end -struct jsonObj +struct DatabaseRow id::Int64 randomNumber::Int64 end -StructTypes.StructType(::Type{jsonMsgObj}) = StructTypes.Struct() -StructTypes.StructType(::Type{jsonObj}) = StructTypes.Struct() +StructTypes.StructType(::Type{Message}) = StructTypes.Struct() +StructTypes.StructType(::Type{DatabaseRow}) = StructTypes.Struct() function getqueries(req) params = HTTP.queryparams(HTTP.URI(req.target).query) return try min(500, max(1, parse(Int64, get(params, "queries", "1")))) - catch ArgumentError + catch ex 1 end end @@ -37,7 +36,7 @@ function jsonSerialization(req::HTTP.Request) "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT", ] - return HTTP.Response(200, headers, body = JSON3.write(jsonMsgObj("Hello, World!"))) + return HTTP.Response(200, headers, body = JSON3.write(Message("Hello, World!"))) end function singleQuery(req::HTTP.Request) @@ -55,7 +54,7 @@ function singleQuery(req::HTTP.Request) first(first(results)) end - return HTTP.Response(200, headers, body = JSON3.write(jsonObj(randNum, dbNumber))) + return HTTP.Response(200, headers, body = JSON3.write(DatabaseRow(randNum, dbNumber))) end function multipleQueries(req::HTTP.Request) @@ -66,12 +65,17 @@ function multipleQueries(req::HTTP.Request) ] nqueries = getqueries(req) - responseArray = sizehint!(Vector{jsonObj}(), nqueries) + responseArray = sizehint!(Vector{DatabaseRow}(), nqueries) withdb() do conn for i = 1:nqueries randNum = rand(1:10000) - results = LibPQ.async_execute(conn, "SELECT * FROM World WHERE id = \$1 ", [randNum]) |> fetch - push!(responseArray, jsonObj(randNum, first(results)[2])) + results = + LibPQ.async_execute( + conn, + "SELECT * FROM World WHERE id = \$1 ", + [randNum], + ) |> fetch + push!(responseArray, DatabaseRow(randNum, first(results)[2])) end end return HTTP.Response(200, headers, body = JSON3.write(responseArray)) @@ -85,7 +89,7 @@ function updates(req::HTTP.Request) ] nqueries = getqueries(req) - responseArray = sizehint!(Vector{jsonObj}(), nqueries) + responseArray = sizehint!(Vector{DatabaseRow}(), nqueries) withdb() do conn for i = 1:nqueries randId = rand(1:10000) @@ -96,7 +100,7 @@ function updates(req::HTTP.Request) dbNumber = row[2] sqlQuery = "UPDATE World SET randomnumber = $randNum WHERE id = $randId" results = LibPQ.async_execute(conn, sqlQuery) |> fetch - push!(responseArray, jsonObj(randId, randNum)) + push!(responseArray, DatabaseRow(randId, randNum)) end end diff --git a/frameworks/Julia/Marily/julia_server.jl b/frameworks/Julia/Marily/julia_server.jl index 52d29fd2d88..54f65daf4ec 100644 --- a/frameworks/Julia/Marily/julia_server.jl +++ b/frameworks/Julia/Marily/julia_server.jl @@ -35,7 +35,7 @@ handler = HTTP.streamhandler(router) @info "Julia runs on $(Threads.nthreads()) threads" function restart_server() - server = HTTP.listen!("0.0.0.0", 8080; reuseaddr=true) do http + server = HTTP.listen!("0.0.0.0", 8080; reuseaddr = true) do http # t = ConcurrentUtilities.@spawn handler(http) # wait(t) handler(http) @@ -48,7 +48,10 @@ for _ in Iterators.repeated(true) server = restart_server() wait(server) catch exc - try close(server) catch end + try + close(server) + catch + end if exc isa InterruptException rethrow() end From eaf9fa5d62b6298bcd99e987de76f00e6f193b8a Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Tue, 22 Aug 2023 08:00:32 +0000 Subject: [PATCH 05/13] rename Marily to http-jl --- frameworks/Julia/{Marily => Http.jl}/API.jl | 0 frameworks/Julia/Http.jl/Manifest.toml | 503 ++++++++++++++--- frameworks/Julia/{Marily => Http.jl}/Pool.jl | 0 frameworks/Julia/Http.jl/Project.toml | 9 +- frameworks/Julia/Http.jl/README.md | 25 +- .../Julia/Http.jl/benchmark_config.json | 49 +- frameworks/Julia/Http.jl/config.toml | 15 - frameworks/Julia/Http.jl/http-jl.dockerfile | 36 +- .../Julia/{Marily => Http.jl}/julia_server.jl | 21 +- frameworks/Julia/Http.jl/run.sh | 7 +- frameworks/Julia/Http.jl/server.jl | 28 - frameworks/Julia/Marily/Manifest.toml | 506 ------------------ frameworks/Julia/Marily/Project.toml | 8 - frameworks/Julia/Marily/README.md | 24 - frameworks/Julia/Marily/benchmark_config.json | 28 - frameworks/Julia/Marily/marily.dockerfile | 23 - frameworks/Julia/Marily/run.sh | 5 - 17 files changed, 512 insertions(+), 775 deletions(-) rename frameworks/Julia/{Marily => Http.jl}/API.jl (100%) rename frameworks/Julia/{Marily => Http.jl}/Pool.jl (100%) delete mode 100644 frameworks/Julia/Http.jl/config.toml rename frameworks/Julia/{Marily => Http.jl}/julia_server.jl (74%) delete mode 100644 frameworks/Julia/Http.jl/server.jl delete mode 100644 frameworks/Julia/Marily/Manifest.toml delete mode 100644 frameworks/Julia/Marily/Project.toml delete mode 100644 frameworks/Julia/Marily/README.md delete mode 100644 frameworks/Julia/Marily/benchmark_config.json delete mode 100644 frameworks/Julia/Marily/marily.dockerfile delete mode 100644 frameworks/Julia/Marily/run.sh diff --git a/frameworks/Julia/Marily/API.jl b/frameworks/Julia/Http.jl/API.jl similarity index 100% rename from frameworks/Julia/Marily/API.jl rename to frameworks/Julia/Http.jl/API.jl diff --git a/frameworks/Julia/Http.jl/Manifest.toml b/frameworks/Julia/Http.jl/Manifest.toml index 38aacad52ca..5ffdadc24c4 100644 --- a/frameworks/Julia/Http.jl/Manifest.toml +++ b/frameworks/Julia/Http.jl/Manifest.toml @@ -1,127 +1,506 @@ # This file is machine-generated - editing it directly is not advised -[[Artifacts]] -deps = ["Pkg"] -git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744" +julia_version = "1.9.2" +manifest_format = "2.0" +project_hash = "350c12e51175a69408a5d41399f431a2b8090984" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "3.6.2" + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + + [deps.Adapt.weakdeps] + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -version = "1.3.0" -[[Base64]] +[[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -[[Dates]] +[[deps.BitFlags]] +git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.7" + +[[deps.CEnum]] +git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90" +uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" +version = "0.4.2" + +[[deps.CSTParser]] +deps = ["Tokenize"] +git-tree-sha1 = "3ddd48d200eb8ddf9cb3e0189fc059fd49b97c1f" +uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f" +version = "3.3.6" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "02aa26a4cf76381be7f66e020a3eddeb27b0a092" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.2" + +[[deps.CommonMark]] +deps = ["Crayons", "JSON", "PrecompileTools", "URIs"] +git-tree-sha1 = "532c4185d3c9037c0237546d817858b23cf9e071" +uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6" +version = "0.8.12" + +[[deps.Compat]] +deps = ["UUIDs"] +git-tree-sha1 = "e460f044ca8b99be31d35fe54fc33a5c33dd8ed7" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.9.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.0.5+0" + +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "5372dbbf8f0bdb8c700db5367132925c0771ef7e" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.2.1" + +[[deps.Crayons]] +git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.1.1" + +[[deps.DBInterface]] +git-tree-sha1 = "9b0dc525a052b9269ccc5f7f04d5b3639c65bca5" +uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965" +version = "2.5.0" + +[[deps.DataAPI]] +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.15.0" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.15" + +[[deps.DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" -[[Distributed]] +[[deps.Decimals]] +git-tree-sha1 = "e98abef36d02a0ec385d68cd7dadbce9b28cbd88" +uuid = "abce61dc-4473-55a0-ba07-351d65e31d42" +version = "0.4.1" + +[[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" -[[HTTP]] -deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets", "URIs"] -git-tree-sha1 = "504ca74f27377a25ebfd63b1f5e6ec3e9fb14690" -uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.9.1" +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" -[[IniFile]] +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.ExceptionUnwrapping]] deps = ["Test"] -git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" -uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" -version = "0.5.0" +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + +[[deps.ExprTools]] +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.10" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.Glob]] +git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" +uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" +version = "1.3.1" + +[[deps.HTTP]] +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "cb56ccdd481c0dd7f975ad2b3b62d9eda088f7e2" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "1.9.14" -[[InteractiveUtils]] +[[deps.HypertextLiteral]] +deps = ["Tricks"] +git-tree-sha1 = "c47c5fa4c5308f27ccaac35504858d8914e102f9" +uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" +version = "0.9.4" + +[[deps.Infinity]] +deps = ["Dates", "Random", "Requires"] +git-tree-sha1 = "cf8234411cbeb98676c173f930951ea29dca3b23" +uuid = "a303e19e-6eb4-11e9-3b09-cd9505f79100" +version = "0.2.4" + +[[deps.InlineStrings]] +deps = ["Parsers"] +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" +version = "1.4.0" + +[[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -[[JLLWrappers]] -git-tree-sha1 = "c70593677bbf2c3ccab4f7500d0f4dacfff7b75c" +[[deps.Intervals]] +deps = ["Dates", "Printf", "RecipesBase", "Serialization", "TimeZones"] +git-tree-sha1 = "ac0aaa807ed5eaf13f67afe188ebc07e828ff640" +uuid = "d8418881-c3e1-53bb-8760-2df7ec849ed5" +version = "1.10.0" + +[[deps.IterTools]] +git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.8.0" + +[[deps.IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.1.3" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" -[[JSON3]] -deps = ["Dates", "Mmap", "Parsers", "StructTypes", "UUIDs"] -git-tree-sha1 = "961ef1c3e5c8a595d5bec270a9007429ef12ed10" +[[deps.JSON3]] +deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] +git-tree-sha1 = "95220473901735a0f4df9d1ca5b171b568b2daa3" uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -version = "1.5.1" +version = "1.13.2" -[[LibGit2]] -deps = ["Printf"] +[[deps.JuliaFormatter]] +deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "PrecompileTools", "Tokenize"] +git-tree-sha1 = "680fb31c8b8e2cf482f48e55d8fa01ccc4469e04" +uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" +version = "1.0.35" + +[[deps.Kerberos_krb5_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "60274b4ab38e8d1248216fe6b6ace75ae09b0502" +uuid = "b39eb1a6-c29a-53d7-8c32-632cd16f18da" +version = "1.19.3+0" + +[[deps.LayerDicts]] +git-tree-sha1 = "6087ad3521d6278ebe5c27ae55e7bbb15ca312cb" +uuid = "6f188dcb-512c-564b-bc01-e0f76e72f166" +version = "1.0.0" + +[[deps.LazyArtifacts]] +deps = ["Artifacts", "Pkg"] +uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.3" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "7.84.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" -[[Libdl]] +[[deps.LibPQ]] +deps = ["CEnum", "DBInterface", "Dates", "Decimals", "DocStringExtensions", "FileWatching", "Infinity", "Intervals", "IterTools", "LayerDicts", "LibPQ_jll", "Libdl", "Memento", "OffsetArrays", "SQLStrings", "Tables", "TimeZones", "UTCDateTimes"] +git-tree-sha1 = "ddf729fd85ff07d55b94338ca2f1a4ce2b6dd96e" +uuid = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +version = "1.17.0" + +[[deps.LibPQ_jll]] +deps = ["Artifacts", "JLLWrappers", "Kerberos_krb5_jll", "Libdl", "OpenSSL_jll", "Pkg"] +git-tree-sha1 = "a299629703a93d8efcefccfc16b18ad9a073d131" +uuid = "08be9ffa-1c94-5ee5-a977-46a84ec9b350" +version = "14.3.0+1" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.10.2+0" + +[[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" -[[Logging]] +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" -[[Markdown]] +[[deps.LoggingExtras]] +deps = ["Dates", "Logging"] +git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e" +uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" +version = "1.0.0" + +[[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" -[[MbedTLS]] -deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] -git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe" +[[deps.MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"] +git-tree-sha1 = "03a9b9718f5682ecb107ac9f7308991db4ce395b" uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.0.3" +version = "1.1.7" -[[MbedTLS_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "0eef589dd1c26a3ac9d753fe1a8bcad63f956fa6" +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.16.8+1" +version = "2.28.2+0" + +[[deps.Memento]] +deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"] +git-tree-sha1 = "bb2e8f4d9f400f6e90d57b34860f6abdc51398e5" +uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" +version = "1.4.1" -[[Mmap]] +[[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" -[[Parsers]] -deps = ["Dates"] -git-tree-sha1 = "50c9a9ed8c714945e01cd53a21007ed3865ed714" +[[deps.Mocking]] +deps = ["Compat", "ExprTools"] +git-tree-sha1 = "4cc0c5a83933648b615c36c2b956d94fda70641e" +uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" +version = "0.7.7" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2022.10.11" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.OffsetArrays]] +deps = ["Adapt"] +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.12.10" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.21+4" + +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.4.1" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "bbb5c2115d63c2f1451cb70e5ef75e8fe4707019" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.22+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.2" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.0.15" +version = "2.7.2" -[[Pkg]] -deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.9.2" -[[Printf]] +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.1.2" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.0" + +[[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" -[[REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets"] +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" -[[Random]] -deps = ["Serialization"] +[[deps.Random]] +deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -[[SHA]] +[[deps.RecipesBase]] +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.3.4" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" -[[Serialization]] +[[deps.SQLStrings]] +git-tree-sha1 = "55de0530689832b1d3d43491ee6b67bd54d3323c" +uuid = "af517c2e-c243-48fa-aab8-efac3db270f5" +version = "0.1.0" + +[[deps.Scratch]] +deps = ["Dates"] +git-tree-sha1 = "30449ee12237627992a99d5e30ae63e4d78cd24a" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.2.0" + +[[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -[[Sockets]] +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + +[[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" -[[StructTypes]] +[[deps.StructTypes]] deps = ["Dates", "UUIDs"] -git-tree-sha1 = "d94235fcdc4a09649f263365c5f7e4ed4ba6ed34" +git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.2.1" +version = "1.10.0" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[deps.Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"] +git-tree-sha1 = "1544b926975372da01227b382066ab70e574a3ec" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.10.1" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" -[[Test]] -deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -[[URIs]] -git-tree-sha1 = "bc331715463c41d601cf8bfd38ca70a490af5c5b" +[[deps.TimeZones]] +deps = ["Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "Unicode"] +git-tree-sha1 = "5b347464bdac31eccfdbe1504d9484c31645cafc" +uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" +version = "1.11.0" + +[[deps.Tokenize]] +git-tree-sha1 = "90538bf898832b6ebd900fa40f223e695970e3a5" +uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624" +version = "0.5.25" + +[[deps.TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.13" + +[[deps.Tricks]] +git-tree-sha1 = "aadb748be58b492045b4f56166b5188aa63ce549" +uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" +version = "0.1.7" + +[[deps.URIs]] +git-tree-sha1 = "b7a5e99f24892b6824a954199a45e9ffcc1c70f0" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.1.0" +version = "1.5.0" -[[UUIDs]] +[[deps.UTCDateTimes]] +deps = ["Dates", "TimeZones"] +git-tree-sha1 = "4af3552bf0cf4a071bf3d14bd20023ea70f31b62" +uuid = "0f7cfa37-7abf-4834-b969-a8aa512401c2" +version = "1.6.1" + +[[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" -[[Unicode]] +[[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+0" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.48.0+0" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+0" diff --git a/frameworks/Julia/Marily/Pool.jl b/frameworks/Julia/Http.jl/Pool.jl similarity index 100% rename from frameworks/Julia/Marily/Pool.jl rename to frameworks/Julia/Http.jl/Pool.jl diff --git a/frameworks/Julia/Http.jl/Project.toml b/frameworks/Julia/Http.jl/Project.toml index 76cbdd50004..ba9264822a1 100644 --- a/frameworks/Julia/Http.jl/Project.toml +++ b/frameworks/Julia/Http.jl/Project.toml @@ -1,7 +1,8 @@ [deps] +ConcurrentUtilities = "f0e56b4a-5159-44fe-b623-3e5288b988bb" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" +HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" - -[compat] -HTTP = "^0.9" -JSON3 = "^1.5" +JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" +LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" diff --git a/frameworks/Julia/Http.jl/README.md b/frameworks/Julia/Http.jl/README.md index 5c9689baae3..1c34c059a39 100644 --- a/frameworks/Julia/Http.jl/README.md +++ b/frameworks/Julia/Http.jl/README.md @@ -1,5 +1,24 @@ -An implementation using the [HTTP.jl](https://github.com/JuliaWeb/HTTP.jl) package available for Julia +# Jewelia Benchmark Test -For JSON support, the [JSON3.jl](https://github.com/quinnj/JSON3.jl) is used +[![Build Status](https://github.com/TechEmpower/FrameworkBenchmarks/workflows/build/badge.svg?branch=master&event=push)](https://github.com/TechEmpower/FrameworkBenchmarks/actions?query=workflow%3Abuild+branch%3Amaster) -Currently only the /json and /plaintext endpoints have been implemented +This is a submission for [TechEmpower Framework Benchmarks (TFB)](http://www.techempower.com/benchmarks/) using the [Julia](https://julialang.org/) language. + +All tests are located in [julia_server.jl](https://github.com/donavindebartolo/FrameworkBenchmarks/tree/master/frameworks/Julia/Jewelia). + +### Implemented benchmarks +- [x] JSON serialization +- [x] Single query +- [x] Multiple queries +- [x] Plaintext +- [x] Fortunes +- [x] Updates + +### + +This is an adaptation of the Jewelia benchmark, adapted for updated packages and Julia 1.9. + +Introduces: +- Multi-Threading +- Connection pool the connection +- formatted with JuliaFormatter \ No newline at end of file diff --git a/frameworks/Julia/Http.jl/benchmark_config.json b/frameworks/Julia/Http.jl/benchmark_config.json index ad8ceb6ff55..e5be2c37cb8 100644 --- a/frameworks/Julia/Http.jl/benchmark_config.json +++ b/frameworks/Julia/Http.jl/benchmark_config.json @@ -1,25 +1,28 @@ { - "framework": "http-jl", - "tests": [{ - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "None", - "database": "None", - "framework": "Http.jl", - "language": "Julia", - "orm": "None", - "platform": "None", - "webserver": "HTTP.jl", - "os": "Linux", - "database_os": "Linux", - "display_name": "Http.jl", - "notes": "", - "versus": "", - "tags": [] - } - }] + "framework": "http-jl", + "tests": [{ + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "query_url": "/queries?queries=", + "update_url": "/updates?queries=", + "fortune_url": "/fortunes", + "port": 8080, + "approach": "Realistic", + "classification": "None", + "database": "Postgres", + "framework": "HTTP.jl", + "language": "Julia", + "flavor": "None", + "orm": "Raw", + "platform": "None", + "webserver": "HTTP.jl", + "os": "Linux", + "database_os": "Linux", + "display_name": "HTTP.jl", + "notes": "Http.jl", + "versus": "None" + } + }] } - diff --git a/frameworks/Julia/Http.jl/config.toml b/frameworks/Julia/Http.jl/config.toml deleted file mode 100644 index a47f019cf6e..00000000000 --- a/frameworks/Julia/Http.jl/config.toml +++ /dev/null @@ -1,15 +0,0 @@ -[framework] -name = "http.jl" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/json" -approach = "Realistic" -classification = "None" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "HTTP.jl" -versus = "" diff --git a/frameworks/Julia/Http.jl/http-jl.dockerfile b/frameworks/Julia/Http.jl/http-jl.dockerfile index 35a9a0731d2..012f3d69e42 100644 --- a/frameworks/Julia/Http.jl/http-jl.dockerfile +++ b/frameworks/Julia/Http.jl/http-jl.dockerfile @@ -1,35 +1,23 @@ -FROM ubuntu:20.04 - -ENV IROOT=/installs +FROM julia:1.9.2 ENV DEBIAN_FRONTEND noninteractive -RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - -RUN apt update -yqq && apt-get install -y --reinstall ca-certificates -RUN apt-get update -y && apt-get install -y --no-install-recommends wget - -RUN mkdir /usr/local/share/ca-certificates/cacert.org -RUN wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt -RUN update-ca-certificates -#RUN git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt -WORKDIR ${IROOT} +RUN apt-get update -yqq && apt-get install -y +RUN apt-get update -yqq && apt-get install -y wget -RUN wget -q https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.3-linux-x86_64.tar.gz -RUN tar -xzf julia-1.5.3-linux-x86_64.tar.gz -RUN mv julia-1.5.3 /opt/ -RUN rm -f julia-1.5.3-linux-x86_64.tar.gz -ENV PATH="/opt/julia-1.5.3/bin:${PATH}" +COPY ./Project.toml ./Manifest.toml ./ -COPY *.toml ${IROOT}/ +# This step takes a lot of time, let's aggressively cache it +RUN julia --project=. -e 'import Pkg; Pkg.instantiate();' -RUN julia -e 'import Pkg; Pkg.activate(@__DIR__); Pkg.instantiate()' && \ - julia -e 'import Pkg; Pkg.activate(@__DIR__); Pkg.precompile()' +# Files +COPY ./ ./ -COPY server.jl ${IROOT}/ -COPY run.sh ${IROOT}/ RUN chmod +x run.sh EXPOSE 8080 +# running multiple processes doesn't seem to make any sense +# https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind -CMD ./run.sh +# CMD julia --project=. --threads auto julia_server.jl +CMD ./run.sh \ No newline at end of file diff --git a/frameworks/Julia/Marily/julia_server.jl b/frameworks/Julia/Http.jl/julia_server.jl similarity index 74% rename from frameworks/Julia/Marily/julia_server.jl rename to frameworks/Julia/Http.jl/julia_server.jl index 54f65daf4ec..5593b41596d 100644 --- a/frameworks/Julia/Marily/julia_server.jl +++ b/frameworks/Julia/Http.jl/julia_server.jl @@ -31,10 +31,10 @@ handler = HTTP.streamhandler(router) # running multiple processes doesn't seem to make any sense # https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind -# ConcurrentUtilities.init(40) + @info "Julia runs on $(Threads.nthreads()) threads" -function restart_server() +function start_server() server = HTTP.listen!("0.0.0.0", 8080; reuseaddr = true) do http # t = ConcurrentUtilities.@spawn handler(http) # wait(t) @@ -42,19 +42,4 @@ function restart_server() return nothing end end - -for _ in Iterators.repeated(true) - try - server = restart_server() - wait(server) - catch exc - try - close(server) - catch - end - if exc isa InterruptException - rethrow() - end - @info "Server died, restarting" (exc, catch_backtrace()) - end -end +wait(start_server()) \ No newline at end of file diff --git a/frameworks/Julia/Http.jl/run.sh b/frameworks/Julia/Http.jl/run.sh index 7a3ccf64149..e6bf3dcd049 100644 --- a/frameworks/Julia/Http.jl/run.sh +++ b/frameworks/Julia/Http.jl/run.sh @@ -1,7 +1,6 @@ -#!/bin/sh - -for i in $(seq 0 $(($(nproc --all)-1))); do - julia --threads auto server.jl & +for i in $(seq 0 $(($(nproc --all)-1))); + # https://stackoverflow.com/a/14388707/3757815 + do julia --project=. --threads=2,2 julia_server.jl & done while : ; do sleep 1 ; done diff --git a/frameworks/Julia/Http.jl/server.jl b/frameworks/Julia/Http.jl/server.jl deleted file mode 100644 index 74b0dba052d..00000000000 --- a/frameworks/Julia/Http.jl/server.jl +++ /dev/null @@ -1,28 +0,0 @@ -using Pkg - -Pkg.activate(@__DIR__) - -using HTTP -import JSON3 -using Dates - -@info "starting listener" -HTTP.listen("0.0.0.0", 8080, reuseaddr=true) do http - HTTP.setheader(http, "Server" => "Julia-HTTP") - HTTP.setheader(http, "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT") - if endswith(http.message.target, "/plaintext") - HTTP.setheader(http, "Content-Type" => "text/plain") - HTTP.setstatus(http, 200) - startwrite(http) - write(http, "Hello, World!") - elseif endswith(http.message.target, "/json") - HTTP.setheader(http, "Content-Type" => "application/json") - HTTP.setstatus(http, 200) - startwrite(http) - JSON3.write(http, (;message = "Hello, World!")) - else - HTTP.setstatus(http, 404) - startwrite(http) - write(http, "Not Found") - end -end diff --git a/frameworks/Julia/Marily/Manifest.toml b/frameworks/Julia/Marily/Manifest.toml deleted file mode 100644 index 5ffdadc24c4..00000000000 --- a/frameworks/Julia/Marily/Manifest.toml +++ /dev/null @@ -1,506 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.9.2" -manifest_format = "2.0" -project_hash = "350c12e51175a69408a5d41399f431a2b8090984" - -[[deps.Adapt]] -deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.6.2" - - [deps.Adapt.extensions] - AdaptStaticArraysExt = "StaticArrays" - - [deps.Adapt.weakdeps] - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.BitFlags]] -git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d" -uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" -version = "0.1.7" - -[[deps.CEnum]] -git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90" -uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" -version = "0.4.2" - -[[deps.CSTParser]] -deps = ["Tokenize"] -git-tree-sha1 = "3ddd48d200eb8ddf9cb3e0189fc059fd49b97c1f" -uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f" -version = "3.3.6" - -[[deps.CodecZlib]] -deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "02aa26a4cf76381be7f66e020a3eddeb27b0a092" -uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.2" - -[[deps.CommonMark]] -deps = ["Crayons", "JSON", "PrecompileTools", "URIs"] -git-tree-sha1 = "532c4185d3c9037c0237546d817858b23cf9e071" -uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6" -version = "0.8.12" - -[[deps.Compat]] -deps = ["UUIDs"] -git-tree-sha1 = "e460f044ca8b99be31d35fe54fc33a5c33dd8ed7" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.9.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.5+0" - -[[deps.ConcurrentUtilities]] -deps = ["Serialization", "Sockets"] -git-tree-sha1 = "5372dbbf8f0bdb8c700db5367132925c0771ef7e" -uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" -version = "2.2.1" - -[[deps.Crayons]] -git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" -uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" -version = "4.1.1" - -[[deps.DBInterface]] -git-tree-sha1 = "9b0dc525a052b9269ccc5f7f04d5b3639c65bca5" -uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965" -version = "2.5.0" - -[[deps.DataAPI]] -git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" -uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.15.0" - -[[deps.DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.15" - -[[deps.DataValueInterfaces]] -git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" -uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" -version = "1.0.0" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.Decimals]] -git-tree-sha1 = "e98abef36d02a0ec385d68cd7dadbce9b28cbd88" -uuid = "abce61dc-4473-55a0-ba07-351d65e31d42" -version = "0.4.1" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.3" - -[[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" - -[[deps.ExceptionUnwrapping]] -deps = ["Test"] -git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" -uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" -version = "0.1.9" - -[[deps.ExprTools]] -git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" -uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" -version = "0.1.10" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.Glob]] -git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" -uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" -version = "1.3.1" - -[[deps.HTTP]] -deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "cb56ccdd481c0dd7f975ad2b3b62d9eda088f7e2" -uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.9.14" - -[[deps.HypertextLiteral]] -deps = ["Tricks"] -git-tree-sha1 = "c47c5fa4c5308f27ccaac35504858d8914e102f9" -uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" -version = "0.9.4" - -[[deps.Infinity]] -deps = ["Dates", "Random", "Requires"] -git-tree-sha1 = "cf8234411cbeb98676c173f930951ea29dca3b23" -uuid = "a303e19e-6eb4-11e9-3b09-cd9505f79100" -version = "0.2.4" - -[[deps.InlineStrings]] -deps = ["Parsers"] -git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" -uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" -version = "1.4.0" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.Intervals]] -deps = ["Dates", "Printf", "RecipesBase", "Serialization", "TimeZones"] -git-tree-sha1 = "ac0aaa807ed5eaf13f67afe188ebc07e828ff640" -uuid = "d8418881-c3e1-53bb-8760-2df7ec849ed5" -version = "1.10.0" - -[[deps.IterTools]] -git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" -uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.8.0" - -[[deps.IteratorInterfaceExtensions]] -git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" -uuid = "82899510-4779-5014-852e-03e436cf321d" -version = "1.0.0" - -[[deps.JLLWrappers]] -deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" - -[[deps.JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.4" - -[[deps.JSON3]] -deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] -git-tree-sha1 = "95220473901735a0f4df9d1ca5b171b568b2daa3" -uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -version = "1.13.2" - -[[deps.JuliaFormatter]] -deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "PrecompileTools", "Tokenize"] -git-tree-sha1 = "680fb31c8b8e2cf482f48e55d8fa01ccc4469e04" -uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" -version = "1.0.35" - -[[deps.Kerberos_krb5_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "60274b4ab38e8d1248216fe6b6ace75ae09b0502" -uuid = "b39eb1a6-c29a-53d7-8c32-632cd16f18da" -version = "1.19.3+0" - -[[deps.LayerDicts]] -git-tree-sha1 = "6087ad3521d6278ebe5c27ae55e7bbb15ca312cb" -uuid = "6f188dcb-512c-564b-bc01-e0f76e72f166" -version = "1.0.0" - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.3" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "7.84.0+0" - -[[deps.LibGit2]] -deps = ["Base64", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibPQ]] -deps = ["CEnum", "DBInterface", "Dates", "Decimals", "DocStringExtensions", "FileWatching", "Infinity", "Intervals", "IterTools", "LayerDicts", "LibPQ_jll", "Libdl", "Memento", "OffsetArrays", "SQLStrings", "Tables", "TimeZones", "UTCDateTimes"] -git-tree-sha1 = "ddf729fd85ff07d55b94338ca2f1a4ce2b6dd96e" -uuid = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" -version = "1.17.0" - -[[deps.LibPQ_jll]] -deps = ["Artifacts", "JLLWrappers", "Kerberos_krb5_jll", "Libdl", "OpenSSL_jll", "Pkg"] -git-tree-sha1 = "a299629703a93d8efcefccfc16b18ad9a073d131" -uuid = "08be9ffa-1c94-5ee5-a977-46a84ec9b350" -version = "14.3.0+1" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.10.2+0" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.LoggingExtras]] -deps = ["Dates", "Logging"] -git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e" -uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" -version = "1.0.0" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MbedTLS]] -deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"] -git-tree-sha1 = "03a9b9718f5682ecb107ac9f7308991db4ce395b" -uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.1.7" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+0" - -[[deps.Memento]] -deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"] -git-tree-sha1 = "bb2e8f4d9f400f6e90d57b34860f6abdc51398e5" -uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" -version = "1.4.1" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.Mocking]] -deps = ["Compat", "ExprTools"] -git-tree-sha1 = "4cc0c5a83933648b615c36c2b956d94fda70641e" -uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" -version = "0.7.7" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2022.10.11" - -[[deps.NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" - -[[deps.OffsetArrays]] -deps = ["Adapt"] -git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.10" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.21+4" - -[[deps.OpenSSL]] -deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] -git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" -uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" -version = "1.4.1" - -[[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "bbb5c2115d63c2f1451cb70e5ef75e8fe4707019" -uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.22+0" - -[[deps.OrderedCollections]] -git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.6.2" - -[[deps.Parsers]] -deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.7.2" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.9.2" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.1.2" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.0" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA", "Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.RecipesBase]] -deps = ["PrecompileTools"] -git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" -uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.3.4" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.SQLStrings]] -git-tree-sha1 = "55de0530689832b1d3d43491ee6b67bd54d3323c" -uuid = "af517c2e-c243-48fa-aab8-efac3db270f5" -version = "0.1.0" - -[[deps.Scratch]] -deps = ["Dates"] -git-tree-sha1 = "30449ee12237627992a99d5e30ae63e4d78cd24a" -uuid = "6c6a2e73-6563-6170-7368-637461726353" -version = "1.2.0" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.SimpleBufferStream]] -git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" -uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" -version = "1.1.0" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.StructTypes]] -deps = ["Dates", "UUIDs"] -git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" -uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.10.0" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.TableTraits]] -deps = ["IteratorInterfaceExtensions"] -git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" -uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" -version = "1.0.1" - -[[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"] -git-tree-sha1 = "1544b926975372da01227b382066ab70e574a3ec" -uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.10.1" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.0" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.TimeZones]] -deps = ["Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "Unicode"] -git-tree-sha1 = "5b347464bdac31eccfdbe1504d9484c31645cafc" -uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" -version = "1.11.0" - -[[deps.Tokenize]] -git-tree-sha1 = "90538bf898832b6ebd900fa40f223e695970e3a5" -uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624" -version = "0.5.25" - -[[deps.TranscodingStreams]] -deps = ["Random", "Test"] -git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" -uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.13" - -[[deps.Tricks]] -git-tree-sha1 = "aadb748be58b492045b4f56166b5188aa63ce549" -uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" -version = "0.1.7" - -[[deps.URIs]] -git-tree-sha1 = "b7a5e99f24892b6824a954199a45e9ffcc1c70f0" -uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.5.0" - -[[deps.UTCDateTimes]] -deps = ["Dates", "TimeZones"] -git-tree-sha1 = "4af3552bf0cf4a071bf3d14bd20023ea70f31b62" -uuid = "0f7cfa37-7abf-4834-b969-a8aa512401c2" -version = "1.6.1" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+0" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.48.0+0" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+0" diff --git a/frameworks/Julia/Marily/Project.toml b/frameworks/Julia/Marily/Project.toml deleted file mode 100644 index ba9264822a1..00000000000 --- a/frameworks/Julia/Marily/Project.toml +++ /dev/null @@ -1,8 +0,0 @@ -[deps] -ConcurrentUtilities = "f0e56b4a-5159-44fe-b623-3e5288b988bb" -HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" -HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" -JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" -LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" -StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" diff --git a/frameworks/Julia/Marily/README.md b/frameworks/Julia/Marily/README.md deleted file mode 100644 index 1c34c059a39..00000000000 --- a/frameworks/Julia/Marily/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Jewelia Benchmark Test - -[![Build Status](https://github.com/TechEmpower/FrameworkBenchmarks/workflows/build/badge.svg?branch=master&event=push)](https://github.com/TechEmpower/FrameworkBenchmarks/actions?query=workflow%3Abuild+branch%3Amaster) - -This is a submission for [TechEmpower Framework Benchmarks (TFB)](http://www.techempower.com/benchmarks/) using the [Julia](https://julialang.org/) language. - -All tests are located in [julia_server.jl](https://github.com/donavindebartolo/FrameworkBenchmarks/tree/master/frameworks/Julia/Jewelia). - -### Implemented benchmarks -- [x] JSON serialization -- [x] Single query -- [x] Multiple queries -- [x] Plaintext -- [x] Fortunes -- [x] Updates - -### - -This is an adaptation of the Jewelia benchmark, adapted for updated packages and Julia 1.9. - -Introduces: -- Multi-Threading -- Connection pool the connection -- formatted with JuliaFormatter \ No newline at end of file diff --git a/frameworks/Julia/Marily/benchmark_config.json b/frameworks/Julia/Marily/benchmark_config.json deleted file mode 100644 index cd13f9dad67..00000000000 --- a/frameworks/Julia/Marily/benchmark_config.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "framework": "marily", - "tests": [{ - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "db_url": "/db", - "query_url": "/queries?queries=", - "update_url": "/updates?queries=", - "fortune_url": "/fortunes", - "port": 8080, - "approach": "Realistic", - "classification": "None", - "database": "Postgres", - "framework": "HTTP.jl", - "language": "Julia", - "flavor": "None", - "orm": "Raw", - "platform": "None", - "webserver": "HTTP.jl", - "os": "Linux", - "database_os": "Linux", - "display_name": "Marily", - "notes": "Http.jl", - "versus": "None" - } - }] -} diff --git a/frameworks/Julia/Marily/marily.dockerfile b/frameworks/Julia/Marily/marily.dockerfile deleted file mode 100644 index 012f3d69e42..00000000000 --- a/frameworks/Julia/Marily/marily.dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM julia:1.9.2 - -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get update -yqq && apt-get install -y -RUN apt-get update -yqq && apt-get install -y wget - -COPY ./Project.toml ./Manifest.toml ./ - -# This step takes a lot of time, let's aggressively cache it -RUN julia --project=. -e 'import Pkg; Pkg.instantiate();' - -# Files -COPY ./ ./ - -RUN chmod +x run.sh - -EXPOSE 8080 -# running multiple processes doesn't seem to make any sense -# https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind - -# CMD julia --project=. --threads auto julia_server.jl -CMD ./run.sh \ No newline at end of file diff --git a/frameworks/Julia/Marily/run.sh b/frameworks/Julia/Marily/run.sh deleted file mode 100644 index 3c5a5996045..00000000000 --- a/frameworks/Julia/Marily/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -for i in $(seq 0 $(($(nproc --all)-1))); - do julia --project=. --threads auto julia_server.jl & - done - -while : ; do sleep 1 ; done From 2d6d0b84383b35c99257c4b28fbfc12f8a262e3b Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 27 Aug 2023 20:11:25 +0000 Subject: [PATCH 06/13] fix: format --- frameworks/Julia/Http.jl/Manifest.toml | 24 +++++++++++++++--------- frameworks/Julia/Http.jl/julia_server.jl | 14 +++++++++----- frameworks/Julia/Http.jl/run.sh | 12 +++++++----- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/frameworks/Julia/Http.jl/Manifest.toml b/frameworks/Julia/Http.jl/Manifest.toml index 5ffdadc24c4..64dfaca4e98 100644 --- a/frameworks/Julia/Http.jl/Manifest.toml +++ b/frameworks/Julia/Http.jl/Manifest.toml @@ -243,9 +243,9 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibPQ]] deps = ["CEnum", "DBInterface", "Dates", "Decimals", "DocStringExtensions", "FileWatching", "Infinity", "Intervals", "IterTools", "LayerDicts", "LibPQ_jll", "Libdl", "Memento", "OffsetArrays", "SQLStrings", "Tables", "TimeZones", "UTCDateTimes"] -git-tree-sha1 = "ddf729fd85ff07d55b94338ca2f1a4ce2b6dd96e" +git-tree-sha1 = "74feb1a63ebbcdcf1730016d2a4dfad0a655404f" uuid = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" -version = "1.17.0" +version = "1.17.1" [[deps.LibPQ_jll]] deps = ["Artifacts", "JLLWrappers", "Kerberos_krb5_jll", "Libdl", "OpenSSL_jll", "Pkg"] @@ -270,9 +270,9 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.LoggingExtras]] deps = ["Dates", "Logging"] -git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e" +git-tree-sha1 = "a03c77519ab45eb9a34d3cfe2ca223d79c064323" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" -version = "1.0.0" +version = "1.0.1" [[deps.Markdown]] deps = ["Base64"] @@ -353,9 +353,9 @@ version = "1.9.2" [[deps.PrecompileTools]] deps = ["Preferences"] -git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.1.2" +version = "1.2.0" [[deps.Preferences]] deps = ["TOML"] @@ -424,6 +424,12 @@ deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" version = "1.0.3" +[[deps.TZJData]] +deps = ["Artifacts"] +git-tree-sha1 = "d39314cdbaf5b90a047db33858626f8d1cc973e1" +uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" +version = "1.0.0+2023c" + [[deps.TableTraits]] deps = ["IteratorInterfaceExtensions"] git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" @@ -446,10 +452,10 @@ deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TimeZones]] -deps = ["Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "Unicode"] -git-tree-sha1 = "5b347464bdac31eccfdbe1504d9484c31645cafc" +deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "TZJData", "Unicode", "p7zip_jll"] +git-tree-sha1 = "8dfeeb90ba3fda8c69873c961e397b6541bdc4e6" uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" -version = "1.11.0" +version = "1.12.0" [[deps.Tokenize]] git-tree-sha1 = "90538bf898832b6ebd900fa40f223e695970e3a5" diff --git a/frameworks/Julia/Http.jl/julia_server.jl b/frameworks/Julia/Http.jl/julia_server.jl index 5593b41596d..4113218b5e9 100644 --- a/frameworks/Julia/Http.jl/julia_server.jl +++ b/frameworks/Julia/Http.jl/julia_server.jl @@ -34,12 +34,16 @@ handler = HTTP.streamhandler(router) @info "Julia runs on $(Threads.nthreads()) threads" -function start_server() - server = HTTP.listen!("0.0.0.0", 8080; reuseaddr = true) do http - # t = ConcurrentUtilities.@spawn handler(http) - # wait(t) +backlog = try + parse(Int, split(readchomp(`sysctl net.core.somaxconn`), " = ")[2]) +catch + 511 +end + +HTTP.listen("0.0.0.0", 8080; backlog = backlog, reuseaddr = true) do http + try handler(http) + finally return nothing end end -wait(start_server()) \ No newline at end of file diff --git a/frameworks/Julia/Http.jl/run.sh b/frameworks/Julia/Http.jl/run.sh index e6bf3dcd049..bad6e496ccb 100644 --- a/frameworks/Julia/Http.jl/run.sh +++ b/frameworks/Julia/Http.jl/run.sh @@ -1,6 +1,8 @@ -for i in $(seq 0 $(($(nproc --all)-1))); - # https://stackoverflow.com/a/14388707/3757815 - do julia --project=. --threads=2,2 julia_server.jl & -done +# for i in $(seq 0 $(($(nproc --all)-1))); +# # https://stackoverflow.com/a/14388707/3757815 +# do julia --project=. --threads=2,2 julia_server.jl & +# done +# +# while : ; do sleep 1 ; done -while : ; do sleep 1 ; done +julia --project=. --threads=auto julia_server.jl From c8c06c5f2dab9d2b1a2882ce17af5f67fab04e98 Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 27 Aug 2023 21:25:22 +0000 Subject: [PATCH 07/13] 1.9.3, format etc --- frameworks/Julia/Http.jl/Manifest.toml | 2 +- frameworks/Julia/Http.jl/http-jl.dockerfile | 2 +- frameworks/Julia/Http.jl/julia_server.jl | 15 +++------------ frameworks/Julia/Http.jl/run.sh | 14 +++++++------- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/frameworks/Julia/Http.jl/Manifest.toml b/frameworks/Julia/Http.jl/Manifest.toml index 64dfaca4e98..f2fcc0202b0 100644 --- a/frameworks/Julia/Http.jl/Manifest.toml +++ b/frameworks/Julia/Http.jl/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.9.2" +julia_version = "1.9.3" manifest_format = "2.0" project_hash = "350c12e51175a69408a5d41399f431a2b8090984" diff --git a/frameworks/Julia/Http.jl/http-jl.dockerfile b/frameworks/Julia/Http.jl/http-jl.dockerfile index 012f3d69e42..53b9f63470c 100644 --- a/frameworks/Julia/Http.jl/http-jl.dockerfile +++ b/frameworks/Julia/Http.jl/http-jl.dockerfile @@ -1,4 +1,4 @@ -FROM julia:1.9.2 +FROM julia:1.9.3 ENV DEBIAN_FRONTEND noninteractive diff --git a/frameworks/Julia/Http.jl/julia_server.jl b/frameworks/Julia/Http.jl/julia_server.jl index 4113218b5e9..77daee8c9dc 100644 --- a/frameworks/Julia/Http.jl/julia_server.jl +++ b/frameworks/Julia/Http.jl/julia_server.jl @@ -26,24 +26,15 @@ HTTP.register!(router, "GET", "/fortunes", fortunes) HTTP.register!(router, "/**", notfound) HTTP.register!(router, "/", notfound) -handler = HTTP.streamhandler(router) - -# running multiple processes doesn't seem to make any sense +# running multiple threads doesn't seem to make any sense # https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind - @info "Julia runs on $(Threads.nthreads()) threads" - backlog = try parse(Int, split(readchomp(`sysctl net.core.somaxconn`), " = ")[2]) catch 511 end - -HTTP.listen("0.0.0.0", 8080; backlog = backlog, reuseaddr = true) do http - try - handler(http) - finally - return nothing - end +HTTP.serve("0.0.0.0", 8080; backlog = backlog, reuseaddr = true) do request::HTTP.Request + return router(request) end diff --git a/frameworks/Julia/Http.jl/run.sh b/frameworks/Julia/Http.jl/run.sh index bad6e496ccb..220fbd6041b 100644 --- a/frameworks/Julia/Http.jl/run.sh +++ b/frameworks/Julia/Http.jl/run.sh @@ -1,8 +1,8 @@ -# for i in $(seq 0 $(($(nproc --all)-1))); -# # https://stackoverflow.com/a/14388707/3757815 -# do julia --project=. --threads=2,2 julia_server.jl & -# done -# -# while : ; do sleep 1 ; done +for i in $(seq 0 $(($(nproc --all)-1))); + # https://stackoverflow.com/a/14388707/3757815 + do julia --project=. --threads=2,2 julia_server.jl & +done -julia --project=. --threads=auto julia_server.jl +while : ; do sleep 1 ; done + +# julia --project=. --threads=auto julia_server.jl From 17ddf1b1c44a8af1fddfcbc3fc7204927fd9cddd Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Tue, 29 Aug 2023 19:29:03 +0000 Subject: [PATCH 08/13] add 4 benchmarks for Oxygen.jl --- frameworks/Julia/Http.jl/API.jl | 4 ++++ frameworks/Julia/Http.jl/Manifest.toml | 13 ++++++++++- frameworks/Julia/Http.jl/Pool.jl | 2 +- frameworks/Julia/Http.jl/Project.toml | 1 + .../Julia/Http.jl/benchmark_config.json | 21 ++++++++++++++++++ .../Julia/Http.jl/http-jl-oxygen.dockerfile | 20 +++++++++++++++++ frameworks/Julia/Http.jl/julia_server.jl | 5 ----- frameworks/Julia/Http.jl/oxygen.jl | 22 +++++++++++++++++++ 8 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile create mode 100644 frameworks/Julia/Http.jl/oxygen.jl diff --git a/frameworks/Julia/Http.jl/API.jl b/frameworks/Julia/Http.jl/API.jl index 3a38626e519..e750dca5ceb 100644 --- a/frameworks/Julia/Http.jl/API.jl +++ b/frameworks/Julia/Http.jl/API.jl @@ -19,6 +19,10 @@ function getqueries(req) end end +function notfound(request) + return HTTP.Response(404, [], "") +end + function plaintext(req::HTTP.Request) headers = [ "Content-Type" => "text/plain", diff --git a/frameworks/Julia/Http.jl/Manifest.toml b/frameworks/Julia/Http.jl/Manifest.toml index f2fcc0202b0..4d1cd2bd6d1 100644 --- a/frameworks/Julia/Http.jl/Manifest.toml +++ b/frameworks/Julia/Http.jl/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.9.3" manifest_format = "2.0" -project_hash = "350c12e51175a69408a5d41399f431a2b8090984" +project_hash = "f7c00badcd2c8d6084164890ce9ab6f61656222f" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] @@ -274,6 +274,11 @@ git-tree-sha1 = "a03c77519ab45eb9a34d3cfe2ca223d79c064323" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" version = "1.0.1" +[[deps.MIMEs]] +git-tree-sha1 = "65f28ad4b594aebe22157d6fac869786a255b7eb" +uuid = "6c6e2e6c-3030-632d-7369-2d6c69616d65" +version = "0.1.4" + [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" @@ -340,6 +345,12 @@ git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" version = "1.6.2" +[[deps.Oxygen]] +deps = ["Dates", "HTTP", "JSON3", "MIMEs", "Sockets"] +git-tree-sha1 = "dca31e833aafb6277e5aff9fdcb5029be5045255" +uuid = "df9a0d86-3283-4920-82dc-4555fc0d1d8b" +version = "1.1.11" + [[deps.Parsers]] deps = ["Dates", "PrecompileTools", "UUIDs"] git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" diff --git a/frameworks/Julia/Http.jl/Pool.jl b/frameworks/Julia/Http.jl/Pool.jl index 63f42ca1a62..1e911d41c16 100644 --- a/frameworks/Julia/Http.jl/Pool.jl +++ b/frameworks/Julia/Http.jl/Pool.jl @@ -1,4 +1,4 @@ -cnxpool = Pools.Pool{LibPQ.Connection}(25) +cnxpool = Pools.Pool{LibPQ.Connection}(2) function cnxisok(cnx::LibPQ.Connection) return LibPQ.status(cnx) == LibPQ.libpq_c.CONNECTION_OK diff --git a/frameworks/Julia/Http.jl/Project.toml b/frameworks/Julia/Http.jl/Project.toml index ba9264822a1..adcc6c89df7 100644 --- a/frameworks/Julia/Http.jl/Project.toml +++ b/frameworks/Julia/Http.jl/Project.toml @@ -5,4 +5,5 @@ HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +Oxygen = "df9a0d86-3283-4920-82dc-4555fc0d1d8b" StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" diff --git a/frameworks/Julia/Http.jl/benchmark_config.json b/frameworks/Julia/Http.jl/benchmark_config.json index e5be2c37cb8..2d4c89cc737 100644 --- a/frameworks/Julia/Http.jl/benchmark_config.json +++ b/frameworks/Julia/Http.jl/benchmark_config.json @@ -23,6 +23,27 @@ "display_name": "HTTP.jl", "notes": "Http.jl", "versus": "None" + }, + "oxygen": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "fortune_url": "/fortunes", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "Postgres", + "framework": "Oxygen", + "language": "Julia", + "flavor": "Julia", + "orm": "Raw", + "platform": "libuv", + "webserver": "HTTP.jl", + "os": "Linux", + "database_os": "Linux", + "display_name": "HTTP.jl [Oxygen]", + "notes": "", + "versus": "Http.jl" } }] } diff --git a/frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile b/frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile new file mode 100644 index 00000000000..c27d8ce413e --- /dev/null +++ b/frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile @@ -0,0 +1,20 @@ +FROM julia:1.9.3 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update -yqq && apt-get install -y +RUN apt-get update -yqq && apt-get install -y wget + +COPY ./Project.toml ./Manifest.toml ./ + +# This step takes a lot of time, let's aggressively cache it +RUN julia --project=. -e 'import Pkg; Pkg.instantiate();' + +# Files +COPY ./ ./ + +RUN chmod +x run.sh + +EXPOSE 8080 + +CMD julia --threads=auto --project=. oxygen.jl diff --git a/frameworks/Julia/Http.jl/julia_server.jl b/frameworks/Julia/Http.jl/julia_server.jl index 77daee8c9dc..22f25c0f40b 100644 --- a/frameworks/Julia/Http.jl/julia_server.jl +++ b/frameworks/Julia/Http.jl/julia_server.jl @@ -10,11 +10,6 @@ using HypertextLiteral: @htl include("Pool.jl") include("API.jl") -function notfound(request) - @info "Not found" - return HTTP.Response(404, [], "") -end - router = HTTP.Router() HTTP.register!(router, "GET", "/plaintext", plaintext) diff --git a/frameworks/Julia/Http.jl/oxygen.jl b/frameworks/Julia/Http.jl/oxygen.jl new file mode 100644 index 00000000000..f05cbf94bc3 --- /dev/null +++ b/frameworks/Julia/Http.jl/oxygen.jl @@ -0,0 +1,22 @@ +using Oxygen +using Pkg +using Dates +using HTTP +using LibPQ +using JSON3 +using StructTypes +using ConcurrentUtilities: ConcurrentUtilities, Pools +using HypertextLiteral: @htl + +include("Pool.jl") +include("API.jl") + + +@get "/plaintext" plaintext +@get "/json" jsonSerialization +@get "/db" singleQuery +@get "/queries" multipleQueries +@get "/updates" updates +@get "/fortunes" fortunes + +serveparallel(queuesize = 2 << 14, access_log = nothing, host = "0.0.0.0", port = 8080) From 93f1b3fa4c5ca7e1dfad22692c4975cd6ab421c9 Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Tue, 29 Aug 2023 20:00:37 +0000 Subject: [PATCH 09/13] Revert "add 4 benchmarks for Oxygen.jl" This reverts commit 17ddf1b1c44a8af1fddfcbc3fc7204927fd9cddd. --- frameworks/Julia/Http.jl/API.jl | 4 ---- frameworks/Julia/Http.jl/Manifest.toml | 13 +---------- frameworks/Julia/Http.jl/Pool.jl | 2 +- frameworks/Julia/Http.jl/Project.toml | 1 - .../Julia/Http.jl/benchmark_config.json | 21 ------------------ .../Julia/Http.jl/http-jl-oxygen.dockerfile | 20 ----------------- frameworks/Julia/Http.jl/julia_server.jl | 5 +++++ frameworks/Julia/Http.jl/oxygen.jl | 22 ------------------- 8 files changed, 7 insertions(+), 81 deletions(-) delete mode 100644 frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile delete mode 100644 frameworks/Julia/Http.jl/oxygen.jl diff --git a/frameworks/Julia/Http.jl/API.jl b/frameworks/Julia/Http.jl/API.jl index e750dca5ceb..3a38626e519 100644 --- a/frameworks/Julia/Http.jl/API.jl +++ b/frameworks/Julia/Http.jl/API.jl @@ -19,10 +19,6 @@ function getqueries(req) end end -function notfound(request) - return HTTP.Response(404, [], "") -end - function plaintext(req::HTTP.Request) headers = [ "Content-Type" => "text/plain", diff --git a/frameworks/Julia/Http.jl/Manifest.toml b/frameworks/Julia/Http.jl/Manifest.toml index 4d1cd2bd6d1..f2fcc0202b0 100644 --- a/frameworks/Julia/Http.jl/Manifest.toml +++ b/frameworks/Julia/Http.jl/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.9.3" manifest_format = "2.0" -project_hash = "f7c00badcd2c8d6084164890ce9ab6f61656222f" +project_hash = "350c12e51175a69408a5d41399f431a2b8090984" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] @@ -274,11 +274,6 @@ git-tree-sha1 = "a03c77519ab45eb9a34d3cfe2ca223d79c064323" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" version = "1.0.1" -[[deps.MIMEs]] -git-tree-sha1 = "65f28ad4b594aebe22157d6fac869786a255b7eb" -uuid = "6c6e2e6c-3030-632d-7369-2d6c69616d65" -version = "0.1.4" - [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" @@ -345,12 +340,6 @@ git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" version = "1.6.2" -[[deps.Oxygen]] -deps = ["Dates", "HTTP", "JSON3", "MIMEs", "Sockets"] -git-tree-sha1 = "dca31e833aafb6277e5aff9fdcb5029be5045255" -uuid = "df9a0d86-3283-4920-82dc-4555fc0d1d8b" -version = "1.1.11" - [[deps.Parsers]] deps = ["Dates", "PrecompileTools", "UUIDs"] git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" diff --git a/frameworks/Julia/Http.jl/Pool.jl b/frameworks/Julia/Http.jl/Pool.jl index 1e911d41c16..63f42ca1a62 100644 --- a/frameworks/Julia/Http.jl/Pool.jl +++ b/frameworks/Julia/Http.jl/Pool.jl @@ -1,4 +1,4 @@ -cnxpool = Pools.Pool{LibPQ.Connection}(2) +cnxpool = Pools.Pool{LibPQ.Connection}(25) function cnxisok(cnx::LibPQ.Connection) return LibPQ.status(cnx) == LibPQ.libpq_c.CONNECTION_OK diff --git a/frameworks/Julia/Http.jl/Project.toml b/frameworks/Julia/Http.jl/Project.toml index adcc6c89df7..ba9264822a1 100644 --- a/frameworks/Julia/Http.jl/Project.toml +++ b/frameworks/Julia/Http.jl/Project.toml @@ -5,5 +5,4 @@ HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" -Oxygen = "df9a0d86-3283-4920-82dc-4555fc0d1d8b" StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" diff --git a/frameworks/Julia/Http.jl/benchmark_config.json b/frameworks/Julia/Http.jl/benchmark_config.json index 2d4c89cc737..e5be2c37cb8 100644 --- a/frameworks/Julia/Http.jl/benchmark_config.json +++ b/frameworks/Julia/Http.jl/benchmark_config.json @@ -23,27 +23,6 @@ "display_name": "HTTP.jl", "notes": "Http.jl", "versus": "None" - }, - "oxygen": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "db_url": "/db", - "fortune_url": "/fortunes", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "Postgres", - "framework": "Oxygen", - "language": "Julia", - "flavor": "Julia", - "orm": "Raw", - "platform": "libuv", - "webserver": "HTTP.jl", - "os": "Linux", - "database_os": "Linux", - "display_name": "HTTP.jl [Oxygen]", - "notes": "", - "versus": "Http.jl" } }] } diff --git a/frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile b/frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile deleted file mode 100644 index c27d8ce413e..00000000000 --- a/frameworks/Julia/Http.jl/http-jl-oxygen.dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM julia:1.9.3 - -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get update -yqq && apt-get install -y -RUN apt-get update -yqq && apt-get install -y wget - -COPY ./Project.toml ./Manifest.toml ./ - -# This step takes a lot of time, let's aggressively cache it -RUN julia --project=. -e 'import Pkg; Pkg.instantiate();' - -# Files -COPY ./ ./ - -RUN chmod +x run.sh - -EXPOSE 8080 - -CMD julia --threads=auto --project=. oxygen.jl diff --git a/frameworks/Julia/Http.jl/julia_server.jl b/frameworks/Julia/Http.jl/julia_server.jl index 22f25c0f40b..77daee8c9dc 100644 --- a/frameworks/Julia/Http.jl/julia_server.jl +++ b/frameworks/Julia/Http.jl/julia_server.jl @@ -10,6 +10,11 @@ using HypertextLiteral: @htl include("Pool.jl") include("API.jl") +function notfound(request) + @info "Not found" + return HTTP.Response(404, [], "") +end + router = HTTP.Router() HTTP.register!(router, "GET", "/plaintext", plaintext) diff --git a/frameworks/Julia/Http.jl/oxygen.jl b/frameworks/Julia/Http.jl/oxygen.jl deleted file mode 100644 index f05cbf94bc3..00000000000 --- a/frameworks/Julia/Http.jl/oxygen.jl +++ /dev/null @@ -1,22 +0,0 @@ -using Oxygen -using Pkg -using Dates -using HTTP -using LibPQ -using JSON3 -using StructTypes -using ConcurrentUtilities: ConcurrentUtilities, Pools -using HypertextLiteral: @htl - -include("Pool.jl") -include("API.jl") - - -@get "/plaintext" plaintext -@get "/json" jsonSerialization -@get "/db" singleQuery -@get "/queries" multipleQueries -@get "/updates" updates -@get "/fortunes" fortunes - -serveparallel(queuesize = 2 << 14, access_log = nothing, host = "0.0.0.0", port = 8080) From 414de87313810b4411cafe1e8ad8b54b2d092ee5 Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 3 Sep 2023 13:26:20 +0000 Subject: [PATCH 10/13] benchmark updated HTTP, LibPQ --- frameworks/Julia/Http.jl/Manifest-1.toml | 516 ++++++++++++++++++ frameworks/Julia/Http.jl/Pool.jl | 16 +- frameworks/Julia/Http.jl/Project.toml | 1 + .../Julia/Http.jl/benchmark_config.json | 23 + .../Julia/Http.jl/http-jl-patched.dockerfile | 24 + frameworks/Julia/Http.jl/http-jl.dockerfile | 4 +- frameworks/Julia/Http.jl/julia_server.jl | 11 +- 7 files changed, 585 insertions(+), 10 deletions(-) create mode 100644 frameworks/Julia/Http.jl/Manifest-1.toml create mode 100644 frameworks/Julia/Http.jl/http-jl-patched.dockerfile diff --git a/frameworks/Julia/Http.jl/Manifest-1.toml b/frameworks/Julia/Http.jl/Manifest-1.toml new file mode 100644 index 00000000000..4e955f50782 --- /dev/null +++ b/frameworks/Julia/Http.jl/Manifest-1.toml @@ -0,0 +1,516 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.9.3" +manifest_format = "2.0" +project_hash = "e324b5f3e3160bb820eba999ed429a47e69488cb" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "3.6.2" + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + + [deps.Adapt.weakdeps] + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BitFlags]] +git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.7" + +[[deps.CEnum]] +git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90" +uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" +version = "0.4.2" + +[[deps.CSTParser]] +deps = ["Tokenize"] +git-tree-sha1 = "3ddd48d200eb8ddf9cb3e0189fc059fd49b97c1f" +uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f" +version = "3.3.6" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "02aa26a4cf76381be7f66e020a3eddeb27b0a092" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.2" + +[[deps.CommonMark]] +deps = ["Crayons", "JSON", "PrecompileTools", "URIs"] +git-tree-sha1 = "532c4185d3c9037c0237546d817858b23cf9e071" +uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6" +version = "0.8.12" + +[[deps.Compat]] +deps = ["UUIDs"] +git-tree-sha1 = "e460f044ca8b99be31d35fe54fc33a5c33dd8ed7" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.9.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.0.5+0" + +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "5372dbbf8f0bdb8c700db5367132925c0771ef7e" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.2.1" + +[[deps.Crayons]] +git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.1.1" + +[[deps.DBInterface]] +git-tree-sha1 = "9b0dc525a052b9269ccc5f7f04d5b3639c65bca5" +uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965" +version = "2.5.0" + +[[deps.DataAPI]] +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.15.0" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.15" + +[[deps.DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.Decimals]] +git-tree-sha1 = "e98abef36d02a0ec385d68cd7dadbce9b28cbd88" +uuid = "abce61dc-4473-55a0-ba07-351d65e31d42" +version = "0.4.1" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + +[[deps.ExprTools]] +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.10" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.Glob]] +git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" +uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" +version = "1.3.1" + +[[deps.HTTP]] +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "7a0c684c77161441d36181e4f2afa5cf5957e856" +repo-rev = "fast-accept" +repo-url = "https://github.com/pankgeorg/HTTP.jl.git" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "1.9.14" + +[[deps.HypertextLiteral]] +deps = ["Tricks"] +git-tree-sha1 = "c47c5fa4c5308f27ccaac35504858d8914e102f9" +uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" +version = "0.9.4" + +[[deps.Infinity]] +deps = ["Dates", "Random", "Requires"] +git-tree-sha1 = "cf8234411cbeb98676c173f930951ea29dca3b23" +uuid = "a303e19e-6eb4-11e9-3b09-cd9505f79100" +version = "0.2.4" + +[[deps.InlineStrings]] +deps = ["Parsers"] +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" +version = "1.4.0" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.Intervals]] +deps = ["Dates", "Printf", "RecipesBase", "Serialization", "TimeZones"] +git-tree-sha1 = "ac0aaa807ed5eaf13f67afe188ebc07e828ff640" +uuid = "d8418881-c3e1-53bb-8760-2df7ec849ed5" +version = "1.10.0" + +[[deps.IterTools]] +git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.8.0" + +[[deps.IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JSON3]] +deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] +git-tree-sha1 = "95220473901735a0f4df9d1ca5b171b568b2daa3" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.13.2" + +[[deps.JuliaFormatter]] +deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "PrecompileTools", "Tokenize"] +git-tree-sha1 = "680fb31c8b8e2cf482f48e55d8fa01ccc4469e04" +uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" +version = "1.0.35" + +[[deps.Kerberos_krb5_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "60274b4ab38e8d1248216fe6b6ace75ae09b0502" +uuid = "b39eb1a6-c29a-53d7-8c32-632cd16f18da" +version = "1.19.3+0" + +[[deps.LayerDicts]] +git-tree-sha1 = "6087ad3521d6278ebe5c27ae55e7bbb15ca312cb" +uuid = "6f188dcb-512c-564b-bc01-e0f76e72f166" +version = "1.0.0" + +[[deps.LazyArtifacts]] +deps = ["Artifacts", "Pkg"] +uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.3" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "7.84.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibPQ]] +deps = ["CEnum", "DBInterface", "Dates", "Decimals", "DocStringExtensions", "FileWatching", "Infinity", "Intervals", "IterTools", "LayerDicts", "LibPQ_jll", "Libdl", "Memento", "OffsetArrays", "SQLStrings", "Tables", "TimeZones", "UTCDateTimes"] +git-tree-sha1 = "1537e3c259c83d20d2e5966832d6056f64768d74" +repo-rev = "pg/nonblock" +repo-url = "https://github.com/pankgeorg/LibPQ.jl" +uuid = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +version = "1.17.1" + +[[deps.LibPQ_jll]] +deps = ["Artifacts", "JLLWrappers", "Kerberos_krb5_jll", "Libdl", "OpenSSL_jll", "Pkg"] +git-tree-sha1 = "a299629703a93d8efcefccfc16b18ad9a073d131" +uuid = "08be9ffa-1c94-5ee5-a977-46a84ec9b350" +version = "14.3.0+1" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.10.2+0" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoggingExtras]] +deps = ["Dates", "Logging"] +git-tree-sha1 = "a03c77519ab45eb9a34d3cfe2ca223d79c064323" +uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" +version = "1.0.1" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"] +git-tree-sha1 = "03a9b9718f5682ecb107ac9f7308991db4ce395b" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.1.7" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.2+0" + +[[deps.Memento]] +deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"] +git-tree-sha1 = "bb2e8f4d9f400f6e90d57b34860f6abdc51398e5" +uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" +version = "1.4.1" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.Mocking]] +deps = ["Compat", "ExprTools"] +git-tree-sha1 = "4cc0c5a83933648b615c36c2b956d94fda70641e" +uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" +version = "0.7.7" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2022.10.11" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.OffsetArrays]] +deps = ["Adapt"] +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.12.10" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.21+4" + +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.4.1" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "bbb5c2115d63c2f1451cb70e5ef75e8fe4707019" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.22+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.2" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.7.2" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.9.2" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.0" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.0" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA", "Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RecipesBase]] +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.3.4" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.SQLStrings]] +git-tree-sha1 = "55de0530689832b1d3d43491ee6b67bd54d3323c" +uuid = "af517c2e-c243-48fa-aab8-efac3db270f5" +version = "0.1.0" + +[[deps.Scratch]] +deps = ["Dates"] +git-tree-sha1 = "30449ee12237627992a99d5e30ae63e4d78cd24a" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.2.0" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.10.0" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TZJData]] +deps = ["Artifacts"] +git-tree-sha1 = "d39314cdbaf5b90a047db33858626f8d1cc973e1" +uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" +version = "1.0.0+2023c" + +[[deps.TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[deps.Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"] +git-tree-sha1 = "1544b926975372da01227b382066ab70e574a3ec" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.10.1" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.TimeZones]] +deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "TZJData", "Unicode", "p7zip_jll"] +git-tree-sha1 = "8dfeeb90ba3fda8c69873c961e397b6541bdc4e6" +uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" +version = "1.12.0" + +[[deps.Tokenize]] +git-tree-sha1 = "90538bf898832b6ebd900fa40f223e695970e3a5" +uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624" +version = "0.5.25" + +[[deps.TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.13" + +[[deps.Tricks]] +git-tree-sha1 = "aadb748be58b492045b4f56166b5188aa63ce549" +uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" +version = "0.1.7" + +[[deps.URIs]] +git-tree-sha1 = "b7a5e99f24892b6824a954199a45e9ffcc1c70f0" +uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" +version = "1.5.0" + +[[deps.UTCDateTimes]] +deps = ["Dates", "TimeZones"] +git-tree-sha1 = "4af3552bf0cf4a071bf3d14bd20023ea70f31b62" +uuid = "0f7cfa37-7abf-4834-b969-a8aa512401c2" +version = "1.6.1" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+0" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.48.0+0" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+0" diff --git a/frameworks/Julia/Http.jl/Pool.jl b/frameworks/Julia/Http.jl/Pool.jl index 63f42ca1a62..6d52ea1c5fd 100644 --- a/frameworks/Julia/Http.jl/Pool.jl +++ b/frameworks/Julia/Http.jl/Pool.jl @@ -1,14 +1,26 @@ -cnxpool = Pools.Pool{LibPQ.Connection}(25) +const poolsize = 20 +cnxpool = Pools.Pool{LibPQ.Connection}(poolsize) function cnxisok(cnx::LibPQ.Connection) return LibPQ.status(cnx) == LibPQ.libpq_c.CONNECTION_OK end function newconnection() - return LibPQ.Connection( + cnx = LibPQ.Connection( "postgresql://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world", # "postgresql://benchmarkdbuser:benchmarkdbpass@localhost:5555/hello_world" ) + LibPQ.setnonblocking(cnx) && return cnx + error("Could not set connection to nonblocking") +end + +function preinit_pool(poolsize=poolsize) + cnxs = [Base.acquire(newconnection, cnxpool; isvalid = cnxisok) for i in 1:poolsize] + # They all need to exist at the same time; + map(cnxs) do connection + Base.release(cnxpool, connection) + end + @info "preinit $poolsize done" end function withdb(f) diff --git a/frameworks/Julia/Http.jl/Project.toml b/frameworks/Julia/Http.jl/Project.toml index ba9264822a1..fc31cef23f3 100644 --- a/frameworks/Julia/Http.jl/Project.toml +++ b/frameworks/Julia/Http.jl/Project.toml @@ -5,4 +5,5 @@ HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" diff --git a/frameworks/Julia/Http.jl/benchmark_config.json b/frameworks/Julia/Http.jl/benchmark_config.json index e5be2c37cb8..b916f59adb5 100644 --- a/frameworks/Julia/Http.jl/benchmark_config.json +++ b/frameworks/Julia/Http.jl/benchmark_config.json @@ -23,6 +23,29 @@ "display_name": "HTTP.jl", "notes": "Http.jl", "versus": "None" + }, + "patched": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "query_url": "/queries?queries=", + "update_url": "/updates?queries=", + "fortune_url": "/fortunes", + "port": 8080, + "approach": "Realistic", + "classification": "None", + "database": "Postgres", + "framework": "HTTP.jl", + "language": "Julia", + "flavor": "None", + "orm": "Raw", + "platform": "None", + "webserver": "HTTP.jl", + "os": "Linux", + "database_os": "Linux", + "display_name": "HTTP.jl", + "notes": "Http.jl", + "versus": "None" } }] } diff --git a/frameworks/Julia/Http.jl/http-jl-patched.dockerfile b/frameworks/Julia/Http.jl/http-jl-patched.dockerfile new file mode 100644 index 00000000000..f73cda14932 --- /dev/null +++ b/frameworks/Julia/Http.jl/http-jl-patched.dockerfile @@ -0,0 +1,24 @@ +FROM julia:1.9.3 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -yqq && apt-get install -y +RUN apt-get update -yqq && apt-get install -y wget + +COPY ./Project.toml ./Manifest-1.toml ./ +RUN mv Manifest-1.toml Manifest.toml +# This step takes a lot of time, let's aggressively cache it +RUN julia --project=. -e 'import Pkg; Pkg.instantiate();' + +# Files +COPY ./ ./ +RUN mv ./Manifest-1.toml ./Manifest.toml + +RUN chmod +x run.sh + +EXPOSE 8080 +# running multiple processes doesn't seem to make any sense +# https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind + + +CMD ./run.sh \ No newline at end of file diff --git a/frameworks/Julia/Http.jl/http-jl.dockerfile b/frameworks/Julia/Http.jl/http-jl.dockerfile index 53b9f63470c..fb682a77262 100644 --- a/frameworks/Julia/Http.jl/http-jl.dockerfile +++ b/frameworks/Julia/Http.jl/http-jl.dockerfile @@ -1,6 +1,6 @@ FROM julia:1.9.3 -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && apt-get install -y RUN apt-get update -yqq && apt-get install -y wget @@ -19,5 +19,5 @@ EXPOSE 8080 # running multiple processes doesn't seem to make any sense # https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind -# CMD julia --project=. --threads auto julia_server.jl + CMD ./run.sh \ No newline at end of file diff --git a/frameworks/Julia/Http.jl/julia_server.jl b/frameworks/Julia/Http.jl/julia_server.jl index 77daee8c9dc..08f789d939a 100644 --- a/frameworks/Julia/Http.jl/julia_server.jl +++ b/frameworks/Julia/Http.jl/julia_server.jl @@ -6,6 +6,7 @@ using JSON3 using StructTypes using ConcurrentUtilities: ConcurrentUtilities, Pools using HypertextLiteral: @htl +using Logging include("Pool.jl") include("API.jl") @@ -30,11 +31,9 @@ HTTP.register!(router, "/", notfound) # https://docs.julialang.org/en/v1/stdlib/Sockets/#Base.bind @info "Julia runs on $(Threads.nthreads()) threads" -backlog = try - parse(Int, split(readchomp(`sysctl net.core.somaxconn`), " = ")[2]) -catch - 511 -end -HTTP.serve("0.0.0.0", 8080; backlog = backlog, reuseaddr = true) do request::HTTP.Request + +# Logging.disable_logging(Logging.Error) +preinit_pool() +HTTP.serve("0.0.0.0", 8080; backlog = -1, reuseaddr = true) do request::HTTP.Request return router(request) end From 51aecffebbea13bf328e1d4696f061f79dccd928 Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 3 Sep 2023 14:19:51 +0000 Subject: [PATCH 11/13] small-fix --- frameworks/Julia/Http.jl/Pool.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/Julia/Http.jl/Pool.jl b/frameworks/Julia/Http.jl/Pool.jl index 6d52ea1c5fd..7b29c0d029b 100644 --- a/frameworks/Julia/Http.jl/Pool.jl +++ b/frameworks/Julia/Http.jl/Pool.jl @@ -10,6 +10,7 @@ function newconnection() "postgresql://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world", # "postgresql://benchmarkdbuser:benchmarkdbpass@localhost:5555/hello_world" ) + !isdefined(LibPQ, :setnonblocking) && return cnx LibPQ.setnonblocking(cnx) && return cnx error("Could not set connection to nonblocking") end From 510f1040566dfe18e61533342ac10781060d02ef Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 3 Sep 2023 20:19:14 +0000 Subject: [PATCH 12/13] feat: separate strategies, use max_connections --- frameworks/Julia/Http.jl/strategy.jl | 118 +++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 frameworks/Julia/Http.jl/strategy.jl diff --git a/frameworks/Julia/Http.jl/strategy.jl b/frameworks/Julia/Http.jl/strategy.jl new file mode 100644 index 00000000000..e7a736fa751 --- /dev/null +++ b/frameworks/Julia/Http.jl/strategy.jl @@ -0,0 +1,118 @@ +import Base: wait + +function streamhandler(router) + return function (stream::HTTP.Stream) + request::HTTP.Request = stream.message + request.body = read(stream) + closeread(stream) + request.response::HTTP.Response = try + router(request) + catch ex + Response(500, [], "error") + end + request.response.request = request + try + startwrite(stream) + write(stream, request.response.body) + catch; + end + return nothing + end +end + +serve = streamhandler(router) + +simple() = HTTP.listen(serve, "0.0.0.0", 8080; max_connections = 1024) + +######################### Parallel (Oxygen's StreamUntil) + +struct WebRequest + http::HTTP.Stream + done::Threads.Event +end + +mutable struct Handler + server + queue::Channel{WebRequest} + count::Threads.Atomic{Int} + shutdown::Threads.Atomic{Bool} + Handler( queuesize = 1024 ) = begin + new(nothing, Channel{WebRequest}(queuesize), Threads.Atomic{Int}(0), Threads.Atomic{Bool}(false)) + end +end +wait(h::Handler) = wait(h.server) + +function start(host, port, handle_stream, pool=:default, kwargs...) + n = max(Threads.nthreads(pool) - 1, 1) + handler = Handler(n * 1024) + ready_to_accept = Threads.Condition() + + function parallelhandler(stream::HTTP.Stream) + try + if handler.count[] < n + Threads.atomic_add!(handler.count, 1) + local request = WebRequest(stream, Threads.Event()) + put!(handler.queue, request) + wait(request.done) + else + @warn "Dropping connection..." + HTTP.setstatus(stream, 500) + write(stream, "Server overloaded.") + end + catch e + @error "ERROR: " exception=(e, catch_backtrace()) + HTTP.setstatus(stream, 500) + write(stream, "The Server encountered a problem") + end + end + + + function fork() + id = Threads.threadid() + id == 1 && return # Leave thread 1 to handle IO + id == 2 && return begin + server = HTTP.listen!(parallelhandler, host, port, kwargs...) + lock(ready_to_accept) + try + handler.server = server + notify(ready_to_accept) + finally + unlock(ready_to_accept) + end + return nothing + end + @info "Starting Worker Thread ~ id: $(id)" + @async while handler.shutdown[] == false + task = take!(handler.queue) + Threads.atomic_sub!(handler.count, 1) + @async begin + try + handle_stream(task.http) + catch error + @error "ERROR: " exception=(error, catch_backtrace()) + HTTP.setstatus(task.http, 500) + write(task.http, "The Server encountered a problem") + finally + notify(task.done) + end + end + end + end + Threads.@threads :static for i = 1:n + fork() + end + lock(ready_to_accept) + try + while isnothing(handler.server) + wait(ready_to_accept) + end + finally + unlock(ready_to_accept) + end + handler +end + +channelledmultiworker() = begin + handler = start("0.0.0.0", 8080, serve) + wait(handler) +end \ No newline at end of file From c95c5a4eb3beef4862f6f37bc042a3261594210b Mon Sep 17 00:00:00 2001 From: panagiotis georgakopoulos Date: Sun, 3 Sep 2023 20:19:55 +0000 Subject: [PATCH 13/13] feat: separate strategies, use max_connections --- frameworks/Julia/Http.jl/Pool.jl | 2 +- frameworks/Julia/Http.jl/julia_server.jl | 10 ++++++---- frameworks/Julia/Http.jl/run.sh | 14 +++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/frameworks/Julia/Http.jl/Pool.jl b/frameworks/Julia/Http.jl/Pool.jl index 7b29c0d029b..9bf716a7838 100644 --- a/frameworks/Julia/Http.jl/Pool.jl +++ b/frameworks/Julia/Http.jl/Pool.jl @@ -1,4 +1,4 @@ -const poolsize = 20 +const poolsize = 1000 cnxpool = Pools.Pool{LibPQ.Connection}(poolsize) function cnxisok(cnx::LibPQ.Connection) diff --git a/frameworks/Julia/Http.jl/julia_server.jl b/frameworks/Julia/Http.jl/julia_server.jl index 08f789d939a..d4885d418cb 100644 --- a/frameworks/Julia/Http.jl/julia_server.jl +++ b/frameworks/Julia/Http.jl/julia_server.jl @@ -32,8 +32,10 @@ HTTP.register!(router, "/", notfound) @info "Julia runs on $(Threads.nthreads()) threads" -# Logging.disable_logging(Logging.Error) +Logging.disable_logging(Logging.Error) preinit_pool() -HTTP.serve("0.0.0.0", 8080; backlog = -1, reuseaddr = true) do request::HTTP.Request - return router(request) -end + +include("strategy.jl") + +# channelledmultiworker() +simple() \ No newline at end of file diff --git a/frameworks/Julia/Http.jl/run.sh b/frameworks/Julia/Http.jl/run.sh index 220fbd6041b..2416bca128b 100644 --- a/frameworks/Julia/Http.jl/run.sh +++ b/frameworks/Julia/Http.jl/run.sh @@ -1,8 +1,8 @@ -for i in $(seq 0 $(($(nproc --all)-1))); - # https://stackoverflow.com/a/14388707/3757815 - do julia --project=. --threads=2,2 julia_server.jl & -done +# for i in $(seq 0 $(($(nproc --all)-1))); +# # https://stackoverflow.com/a/14388707/3757815 +# do julia --project=. --threads=2,2 julia_server.jl & +# done +# +# while : ; do sleep 1 ; done -while : ; do sleep 1 ; done - -# julia --project=. --threads=auto julia_server.jl +julia --project=. --threads=auto julia_server.jl