Commit graph

69 commits

Author SHA1 Message Date
a0c2970b42
Revert to smaller batch sizes to reduce garbage collection frequency
Reduced batch processing parameters to prevent excessive GC:
- Reduced batch_size from 500 to 100 packets
- Adjusted batch_timeout from 2000ms to 1000ms for faster processing
- Reduced max_demand from 750 to 300 to match smaller batches
- Updated hardcoded fallback from 500 to 100 in packet_consumer.ex
- Changed minor GC trigger from 500 to 100 packets to match batch size

These smaller batch sizes were proven to work well in production and
should significantly reduce the frequency of garbage collection while
maintaining good performance.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19 17:46:04 -05:00
ad2d9c14cf
Fix packet buffer overflow with parallel consumer pool
- Create PacketConsumerPool to run 3 parallel consumers (configurable)
- Increase max_demand from 250 to 750 total (250 per consumer)
- Fix timer management to properly cancel/restart on batch processing
- Configure proper GenStage subscriptions with backpressure control
- Allow unnamed consumers for pool usage

This 3x increase in processing capacity prevents the "Packet buffer full"
warnings by ensuring consumers can keep up with incoming packet rate.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19 14:49:52 -05:00
234fc2010f
Implement critical performance optimizations and error handling
This commit introduces several major performance improvements and adds
robust error handling for malformed HTTP requests:

Performance Optimizations:
- Add database migration with BRIN indexes for time-series data and partial
  indexes for recent queries, significantly improving query performance
- Create global StreamingPacketsPubSub system for real-time packet distribution
  with geographic bounds filtering using ETS for fast lookups
- Refactor PacketConsumer to use Stream module for memory-efficient processing,
  preventing memory accumulation during batch operations
- Implement dedicated BroadcastTaskSupervisor pool for async broadcast operations,
  preventing GenServer blocking on I/O
- Increase database connection pool from 25 to 45 (production) and 15 to 30 (dev)
  for better concurrency support

Error Handling:
- Add SentryFilter to prevent Bandit.HTTPError from missing Host headers from
  cluttering Sentry (common with bots/scanners)
- Configure custom 400 Bad Request error handling
- Filter out common bot/scanner paths from error reporting

All changes include comprehensive test coverage following TDD practices.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 18:19:49 -05:00
1da12cf665
Remove debug console.log statements from JavaScript files
- Removed all console.log debugging statements from app.js (theme changes, chart rendering)
- Removed all console.log statements from map.ts (map initialization, data processing)
- Removed all console.debug statements from map_helpers.ts
- Removed all console.debug statements from map_fixes.ts
- Kept essential console.error and console.warn statements for error handling
- Reduced bundle size by ~1.4kb

This cleanup removes unnecessary debug output while maintaining error reporting
for production debugging via console.error and Sentry.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 15:37:05 -05:00
1c7a1754ee
add sentry-cdn to cors 2025-07-18 15:23:58 -05:00
4af0f4a421
Fix JavaScript context binding issues in map component
- Fix "this.__view is undefined" error when calling pushEvent in event handlers
- Bind pushEvent context properly in all marker click and hover handlers
- Replace undefined sendBoundsToServer calls with saveMapState
- Ensure all event handlers check for pushEvent availability and type
- Use .bind(self) to preserve LiveView hook context in callbacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 15:05:15 -05:00
4b159ba0b7
cleanup 2025-07-18 14:44:52 -05:00
8d5bfe127e
add email 2025-07-18 10:15:09 -05:00
53c88d2262
postgres optimization 2025-07-15 09:06:40 -05:00
0298c8ec91
Revert all packet processing optimizations to fix buffer overflow
- Restored original PacketConsumer implementation from before optimizations
- Reverted to fixed batch size of 50 packets (original value)
- Removed SystemMonitor and InsertOptimizer from application startup
- Restored original config with buffer size 1000 and batch timeout 1000ms
- Removed all dynamic batch sizing and optimization logic

The recent performance optimizations were causing packet buffer overflows
because the dynamic batch sizing was actually slowing down processing.
Reverting to the simpler, working implementation that processes packets
consistently without buffer overflows.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 08:44:26 -05:00
f1d16d656b
Fix packet buffer overflow by reverting dynamic batch sizing
- Increased packet buffer size from 1,000 to 10,000 to handle traffic spikes
- Removed InsertOptimizer dynamic batch sizing that was slowing processing
- Reverted to fixed batch size of 200 for consistent performance
- Simplified insert options to use static configuration
- Added telemetry metrics for buffer overflow and utilization monitoring
- Fixed unused variable warning in packet_consumer.ex

The root cause was the recent performance optimizations that introduced
dynamic batch sizing, which actually degraded performance and caused
the producer buffer to overflow when the consumer couldn't keep up.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 08:25:02 -05:00
389ce8edeb
cleanup worker tweaks 2025-07-14 12:31:47 -05:00
f26c367b6c
allow reduced historical packet age 2025-07-14 12:14:12 -05:00
062489f5ae
staging fix 2025-07-11 13:19:24 -05:00
f5e0f33ac2
fix geolocation hopefully 2025-07-10 17:12:49 -05:00
38f240b3eb
fix info/neighbor page loading 2025-07-10 14:43:00 -05:00
176e90186d
more ci tweaks 2025-07-09 17:04:33 -05:00
9053f0840a
add more i18n testing and fix error page and dashboard 2025-07-08 12:16:00 -05:00
711d92ebb6
performance improvements 2025-07-08 10:03:52 -05:00
79fa7713ab
release tweak 2025-07-07 17:12:42 -05:00
5a6a782a03
release tweak 2025-07-07 17:09:46 -05:00
06efe1834b
release tweak 2025-07-07 17:02:17 -05:00
0bee0228b0
fix app name 2025-07-07 16:46:48 -05:00
9a6f649157
add clustering 2025-07-07 16:41:14 -05:00
b2f9352091
parser hash fix 2025-07-07 13:02:49 -05:00
6749f41137
built in error tracking 2025-07-07 11:06:22 -05:00
2543617f16
add sentry 2025-07-07 09:52:02 -05:00
cba86fb082
more languages 2025-07-06 10:08:58 -05:00
fc449ed5f9
en español 2025-07-05 15:51:39 -05:00
eafa0feff5
js tweak 2025-07-05 13:16:37 -05:00
294a54823d
cors fix 2025-07-05 13:03:27 -05:00
f1bc428086
deploy fix 2025-07-05 12:51:28 -05:00
53b82c70d4
deploy fix 2025-07-05 09:29:11 -05:00
172da7d393
upgrade more with modern phoenix 2025-07-05 08:04:06 -05:00
7ef3f59026
parsing improvements 2025-06-28 15:53:27 -05:00
9c69141db5
postgres tweaks 2025-06-25 12:10:04 -05:00
d8d69560a3
cleanup to redeploy 2025-06-25 09:31:23 -05:00
91cd2688f7
db timeout increase 2025-06-25 08:57:45 -05:00
0beb278371
add packet batcher 2025-06-24 15:06:09 -05:00
ce7c50caa1
refactor to use external parser 2025-06-24 14:22:09 -05:00
5b50d98036
handle raw feed and fix errors 2025-06-24 11:15:34 -05:00
a48b2edcb3
add device identifier 2025-06-23 14:19:04 -05:00
81a9263b9f
faster tests 2025-06-22 10:58:30 -05:00
d6ac5cccfc
fixes 2025-06-21 12:26:43 -05:00
f6f1ad1e2f
updates 2025-06-21 11:55:30 -05:00
5c171e6acb
add more device ids 2025-06-18 12:31:39 -05:00
369ce05f1a
typescript 2025-06-18 12:26:13 -05:00
464920fbed
test cleanup 2025-06-17 11:26:35 -05:00
3b8d1f2cff
storing fix 2025-06-16 13:11:58 -05:00
6e8f1e434f
dont connect to is server in test 2025-06-16 12:45:35 -05:00