Skip to content

Commit 103d63a

Browse files
Import: single commit preserving current source tree
0 parents  commit 103d63a

98 files changed

Lines changed: 29557 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
APPLICATION_ID=
2+
API_KEY=

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
# Review gh actions docs if you want to further define triggers, paths, etc
7+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
8+
9+
jobs:
10+
deploy:
11+
name: Deploy to GitHub Pages
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
cache: yarn
19+
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
- name: Build website
23+
run: yarn build
24+
25+
# Popular action to deploy to GitHub Pages:
26+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
27+
- name: Deploy to GitHub Pages
28+
uses: peaceiris/actions-gh-pages@v3
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
# Build output to publish to the `gh-pages` branch:
32+
publish_dir: ./build
33+
# The following lines assign commit authorship to the official
34+
# GH-Actions bot for deploys to `gh-pages` branch:
35+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
36+
# The GH actions bot is used by default if you didn't specify the two fields.
37+
# You can swap them out with your own user credentials.
38+
user_name: github-actions[bot]
39+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
.env
18+
.idea
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs.s1nscripts.com

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

algolia.config.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"index_name": "first_index",
3+
"sitemap_urls": ["https://docs.s1nscripts.com/sitemap.xml"],
4+
"start_urls": ["https://docs.s1nscripts.com/docs/"],
5+
"stop_urls": [],
6+
7+
"sitemap_alternate_links": true,
8+
"selectors": {
9+
"lvl0": {
10+
"selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]",
11+
"type": "xpath",
12+
"global": true,
13+
"default_value": "Documentation"
14+
},
15+
"lvl1": "header h1",
16+
"lvl2": "article h2",
17+
"lvl3": "article h3",
18+
"lvl4": "article h4",
19+
"lvl5": "article h5, article td:first-child",
20+
"lvl6": "article h6",
21+
"text": "article p, article li, article td:last-child"
22+
},
23+
24+
"strip_chars": " .,;:#",
25+
"custom_settings": {
26+
"separatorsToIndex": "_",
27+
"attributesForFaceting": ["language", "version", "type", "docusaurus_tag"],
28+
"attributesToRetrieve": [
29+
"hierarchy",
30+
"content",
31+
"anchor",
32+
"url",
33+
"url_without_anchor",
34+
"type"
35+
]
36+
},
37+
"js_render": true
38+
}

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};
93.9 KB
Loading

blog/2021-08-26-welcome/index.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
slug: welcome
3+
title: Welcome
4+
authors: [slorber, yangshun]
5+
tags: [facebook, hello, docusaurus]
6+
---
7+
8+
[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
9+
10+
Simply add Markdown files (or folders) to the `blog` directory.
11+
12+
Regular blog authors can be added to `authors.yml`.
13+
14+
The blog post date can be extracted from filenames, such as:
15+
16+
- `2019-05-30-welcome.md`
17+
- `2019-05-30-welcome/index.md`
18+
19+
A blog post folder can be convenient to co-locate blog post images:
20+
21+
![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)
22+
23+
The blog supports tags as well!
24+
25+
**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: "FiveM Server Performance Optimization: Best Practices & Tips (2024 Guide)"
3+
description: "Learn how to optimize your FiveM server performance with our comprehensive guide covering best practices, configuration tips, and proven optimization techniques."
4+
keywords: ["fivem optimization", "server performance", "fivem server", "performance tips", "fivem lag fix"]
5+
slug: /tutorials/fivem-server-optimization
6+
---
7+
8+
# FiveM Server Performance Optimization: Best Practices & Tips
9+
10+
Running a smooth FiveM server requires careful optimization and regular maintenance. This comprehensive guide will walk you through proven techniques to enhance your server's performance and reduce lag.
11+
12+
## Understanding Server Performance Metrics
13+
14+
Before diving into optimization, it's crucial to understand key performance indicators:
15+
16+
- **Server tick rate**: Ideal range is 48-60ms
17+
- **CPU usage**: Should stay below 80%
18+
- **Memory consumption**: Monitor for memory leaks
19+
- **Network latency**: Target < 100ms for optimal gameplay
20+
21+
## Essential Server Configuration Tweaks
22+
23+
### Basic server.cfg Optimization
24+
25+
```lua
26+
# Performance-related settings
27+
set onesync on
28+
set onesync_population false
29+
set sv_enforceGameBuild 2944
30+
set sv_clockSync true
31+
set sv_scriptHookAllowed 0
32+
33+
# Connection settings
34+
sv_maxClients 48
35+
set sv_endpointPrivacy true
36+
37+
# Network optimization
38+
sv_scriptHookAllowed 0
39+
set sv_forceIndirectListing true
40+
```
41+
42+
### OneSync Configuration
43+
44+
OneSync is crucial for server performance. Here's how to optimize it:
45+
46+
1. Enable OneSync Legacy
47+
2. Configure entity culling
48+
3. Set proper population density
49+
4. Adjust streaming range
50+
51+
## Resource Management
52+
53+
### Script Loading Order
54+
55+
Optimize your resource loading sequence:
56+
57+
1. Core framework resources
58+
2. Database connections
59+
3. Essential game mechanics
60+
4. Optional features
61+
5. Non-essential scripts
62+
63+
### Resource Monitoring
64+
65+
```lua
66+
# Add to server.cfg
67+
set game_enableTaskScheduler true
68+
set game_enableOptimizedScheduler true
69+
```
70+
71+
## Database Optimization
72+
73+
### MySQL Performance Tips
74+
75+
1. Implement connection pooling
76+
2. Use proper indexing
77+
3. Regular database maintenance
78+
4. Query optimization
79+
80+
```sql
81+
-- Example of an optimized query
82+
SELECT * FROM players
83+
WHERE last_seen > DATE_SUB(NOW(), INTERVAL 7 DAY)
84+
INDEX(last_seen);
85+
```
86+
87+
## Common Performance Issues and Solutions
88+
89+
### Script-Related Problems
90+
91+
1. **Memory Leaks**
92+
- Monitor resource memory usage
93+
- Implement garbage collection
94+
- Regular server restarts
95+
96+
2. **CPU Bottlenecks**
97+
- Identify heavy scripts
98+
- Implement async operations
99+
- Optimize loops and functions
100+
101+
### Network Optimization
102+
103+
```lua
104+
-- Network configuration
105+
setr voice_useNativeAudio true
106+
setr voice_useSendingRangeOnly true
107+
set sv_maxConcurrentResources 100
108+
```
109+
110+
## Advanced Optimization Techniques
111+
112+
### Entity Management
113+
114+
1. **Entity Culling**
115+
```lua
116+
-- Add to your resource manifest
117+
lua54 'yes'
118+
game 'gta5'
119+
fx_version 'cerulean'
120+
```
121+
122+
2. **Stream Distance**
123+
```lua
124+
-- Optimized streaming distance
125+
SetStreamDistance(500.0)
126+
```
127+
128+
### Performance Monitoring Tools
129+
130+
1. **Server Monitoring**
131+
- txAdmin dashboard
132+
- Resource monitor
133+
- Network statistics
134+
135+
2. **Diagnostic Tools**
136+
- FiveM debug console
137+
- Performance profiler
138+
- Memory snapshots
139+
140+
## Best Practices for Long-Term Performance
141+
142+
1. Regular maintenance schedule
143+
2. Backup system implementation
144+
3. Update management strategy
145+
4. Resource audit process
146+
147+
## Performance Testing
148+
149+
### Stress Testing Protocol
150+
151+
1. Simulate player load
152+
2. Monitor resource usage
153+
3. Check for memory leaks
154+
4. Verify network stability
155+
156+
## Optimization Checklist
157+
158+
✓ Server configuration review
159+
✓ Resource audit
160+
✓ Database optimization
161+
✓ Network settings
162+
✓ Entity management
163+
✓ Monitoring tools setup
164+
165+
## Conclusion
166+
167+
Optimizing your FiveM server is an ongoing process that requires regular attention and maintenance. By following these best practices and implementing the suggested optimizations, you can significantly improve your server's performance and player experience.
168+
169+
### Additional Resources
170+
171+
- [Official FiveM Documentation](https://docs.fivem.net/)
172+
- [Community Forums](https://forum.cfx.re/)
173+
- [Performance Monitoring Tools](https://your-store-link)
174+
175+
---
176+
177+
*Need professional scripts optimized for performance? Check out our [premium FiveM scripts](your-store-link) designed for maximum efficiency.*

0 commit comments

Comments
 (0)