Bored yet?

Lua file downloads lag your server, and drive new players away.

Servers typically have thousands of Lua files
Your average DarkRP server has around 1000 - 3000 Lua files, but this only adds up to just a few megabytes of data. So why does it take so long to download these files?
Sent through the net channel
Lua files are sent through Garry's Mod's networking channel (the same networking channel that is used by addons to communicate server <-> client), keeping your networking thread busy, causing lag & stuttering, especially after a fresh restart when lots of players are joining & downloading Lua files.
Slow & outdated networking technology
The source engine was designed for internet connections that, at the time, would barely exceed 1 MB/s (if you were lucky!) - Garry's Mod's networking reflects this and is capped at KB/s speeds, causing Lua files to download extremely slowly, despite the fast connections of our modern age.
Limited to 64 KB chunks
Each packet of Lua files sent to a connecting player can only be up to 64 KB in size. Most servers will have megabytes of Lua files to send, and each one of these 64 KB chunks has to be sent one-by-one as a net message, capped at very slow & archaic KB/s speeds.
The solution?

gluapack

by Billy

Purchase on
gluapack Lua Files Size Time
2560 11.92 MB* 236 seconds
2
-99.92%
1.97 MB
-83.50%
56 seconds
-76.27%
*Uncompressed. Garry's Mod compresses each 64 KiB chunk individually.

Benchmark taken from a local SRCDS server running the x86-64 branch with 0 players online.

CPU: AMD Ryzen 9 3950X 16/32 Cores/Threads 3.85 GHz
Disk: Western Digital WDS500G2B0A SATA SSD R/W ~550 MB/s

Results will be better with more players online due to the networking thread being more busy, resulting in slower Lua file downloads compared to using gluapack for Lua file downloads.

Comparison Video  ·  https://titsrp.com/
How does it work?

gluapack for dummies

There's quite a lot of technical sauce here, so here's a summarized list:
  1. When the server boots, it will pack up as many clientside/shared Lua files it can into a single .BSP (map) file.
  2. The server will upload this file to the gluapack CDN (content delivery network).
  3. The server will set sv_downloadurl to a URL that points to the gluapack CDN.
  4. When a player connects, they will download the .BSP file containing your packed clientside/shared Lua files.
  5. If a player needs anything else from FastDL, the gluapack CDN will redirect any subsequent requests to your normal FastDL server, if you have one.
  6. Once the player has spawned in, their client will unpack the .BSP file containing your clientside/shared Lua files into a virtual file system.
  7. gluapack will then invoke the Lua from the virtual file system when it is included, loaded or compiled.
FAQ

This is a service, right?

Yes, gluapack is a service. You do not host any files or data yourself; when purchasing a license to gluapack you are purchasing a license to use the service. Limits may be imposed on your usage of the service and there is an acceptable use policy in place described in the license.
If you abuse the service, or do not use it for its intended purpose, your access to the service can be revoked at the licensor's discretion at any time, without notice.

DRM?

Yes. gluapack uses XEON DRM to verify license keys. The service would be impossible to provide without some kind of DRM, due to the nature of the infrastructure; I wouldn't just let anyone upload anything, would I?!

Is there any configuration?

There is nothing to configure. gluapack is a drop in plugin. It just works ✨

I don't use FastDL, can I still use gluapack?

Of course! gluapack does not require FastDL, but will activate it on your server so that it can serve the clientside/shared Lua files.

What about if I already use FastDL?

No problem! gluapack acts as a proxy in between your FastDL server and the gluapack CDN (for serving clientside/shared Lua files). Any non-Lua file request will be redirected to your own FastDL URL. This process is fully automatic with no additional configuration or requirements, and is fully compatible with automatic FastDL solutions such as those provided by server hosts and game hosting panels.

What is gluapack's infrastructure like?

gluapack is hosted using an AWS (Amazon Web Services) stack, namely, AWS Lambda + S3 + CloudFront, plus CloudFlare on top.
Service SLA/Uptime* Description
AWS Lambda 99.95%
AWS Lambda 99.95% AWS Lambda is a service that provides a "serverless" infrastructure. gluapack has no centralized servers, and no servers running at any given time. Requests made to the gluapack backend spin up an instance of a virtual machine in Amazon's datacenter ("the cloud") (if one is not already available), which handles the request.
AWS S3 99.99%
AWS S3 99.99% AWS S3 is a cloud file/object storage service. This is where gluapack will store your server's compressed clientside/shared Lua files.
AWS CloudFront 99.9%
AWS CloudFront 99.9% AWS CloudFront is a content delivery network (CDN). This is where players will download your server's compressed clientside/shared Lua files from. The CDN provides a decentralized global cache that provides a fast transfer speed to any location in the world. If AWS S3 goes down, CloudFront will still serve cached files.
CloudFlare 100%**
CloudFlare 100%** CloudFlare is a global CDN and DDoS protection provider. All requests to the gluapack backend and CDN are proxied through CloudFlare to protect against DDoS attacks, bots, scrapers, and downtime. CloudFlare provides an additional global layer of caching over AWS CloudFront, and additionally enforces a firewall that only lets through FastDL downloads.
*This is not an SLA provided by gluapack to you. This is the SLA provided by the service/company to gluapack. Please see the gluapack license for more information.
**This figure is from the SLA for CloudFlare Business customers (gluapack does not use this price plan), but the infrastructure is more or less the same.

What happens if the gluapack CDN fails?

Your server will ping the gluapack CDN to make sure it's serving files correctly every so often. If the ping fails, the server will automatically disable gluapack and fall back to normal Lua file networking.

Any clients that connected during this window of time will experience a ton of clientside Lua errors and may even be kicked. Overall, this will not really affect your server and this scenario is extremely unlikely.

In an emergency, super admins can type gluapack_off in console, which will turn gluapack off and revert to vanilla Lua file networking.

Does this protect my clientside files from being stolen?

No. This is simply impossible. However, gluapack will pretty much render any typical "clientside Lua file dumper" that a player may join with mostly useless, unless the dumper is specially crafted to also unpack gluapack's virtual file system.

Does this pack serverside files?

gluapack does not pack serverside files. gluapack only packs clientside/shared files, added with AddCSLuaFile.

Does this pack entire addons, materials, models, etc.?

No, gluapack only packs clientside/shared Lua files. All other server content will be sent through WorkshopDL, FastDL or ServerDL depending on your server's configuration. gluapack does not affect this at all, and would have no benefit in this case.

What happens if my server is somehow unable to upload files to the gluapack backend?

gluapack will simply deactivate and fall back to the vanilla behaviour of sending Lua files to clients.

What about the file library, CompileFile, include, etc.?

The file library does not work with clientside Lua files so this is unaffected.
CompileFile and include work as normal.
gluapack does not pack any files in lua/includes/modules/ as require has a special implementation that we'd rather not mess with.

Can gluapack leak sensitive information?

gluapack only packs Lua files added with AddCSLuaFile. If any sensitive information is sent to clients, it would have been sent without gluapack installed regardless.
However, gluapack will refuse to pack any file with sql anywhere in its path.

What about players that turn off downloads?

The packed clientside/shared Lua files are sent in a .bsp file, so players who set it to "Download map files only" will be able to play with no issue.

However, if a player has set their downloads to "do not download any custom files" then they will be immediately kicked once they join and asked to change their download filter.

Does this mess up Lua errors/stack traces?

No, gluapack does not perform any minification of your Lua files, and therefore Lua errors and stack traces are unaffected.

Will auto refresh still work?

Yes!

The Garry's Mod Lua cache doesn't send files the client already has, does gluapack do the same?

No. This is not really possible. If a single file is changed, clients will have to redownload the entire pack of clientside/shared Lua files, however, almost any internet connection will download files from the gluapack CDN in a matter of seconds, making this practically a non-issue.

Are there any limits to gluapack?

You cannot upload a pack of clientside/shared Lua files that exceeds 20 MB in compressed size. This figure may change depending on what kind of cursed servers I come across. If your files do manage to hit this limit, the upload will be rejected and your server will fall back to serving clientside/shared Lua files normally. Please let me know if you manage to hit this limit.

Content that is illegal or infringes my copyright has been uploaded to the gluapack CDN.

Please contact me at [email protected] with a DMCA takedown or report on an abusive upload and I will handle your request expeditiously.

Uploaders of illegal content and repeat copyright offenders will be banned from the service. I do not care what local laws are in place in any region or country; anything that should not be on the gluapack CDN will be deleted and handled appropriately, as would be expected.